Use your front line fighters to engage as much of the enemy as you can, sort of drawing a line between your guys, and your opponents (think of the offensive line in football). Your mages are your quarterback, they sit behind this line and rely on it for protection. If you are using AOE damage spells like fireballs and such use the indicator to gauge where to throw it; you can usually make it so it hits only your opponents and not your friends if they are stacked up on your front line. If you need to cast a conal aoe or a touch spell, move around your fighters on the flank (like a running play).
Honestly, you can avoid a lot of trouble with friendly fire by having your mages use mostly status debuffing spells to start, or direct damage spells that can't be cast on, or damage friends (like magic missiles). Another mage trick are the "staff" spells, like Concelhault's Parasitic, which give your mage a powerful, longer range melee weapon. He can then poke over the heads of your front line, safe behind them but still doing damage. Alternatively, you can give your mage a gun or some other ranged weapon for some safe dps if you don't want to waste spells.