I've seen answers close to this, but let me answer from a "real world" perspective and then put it into game terms.
First, magic wasn't a reality in Medieval combat so having formations of infantry moving as units is going to have to go. Ranks of men against archers, its effective. If a group of men were suddenly having to deal with exploding Fireballs, the tactics would change.
Real world example #1 - during the close of the Napoleonic era (US Civil War late 1800s) artillery become much more effective than it had been in the past 200 years. Aiming, damage and scatter were ebgining to take their toll on unit numbers. The next major war to use artillery versus an infantry style combat (The Spanish-American War) showed a great many changes in infantry tactics, long lines no longer marched in step to their doom, they spread out in long lines, but in single ranks and charged across open ground in loosely formed groups rather than tightly controlled rank and file.
That being said, if wizards were flinging Fireballs at my troops on a regular basis in combat, I would train my troops to move in a more "fluid" style.
Real World ex #2 - between WWI and WWII it was noted that individual men moving as such, but fighting in concert led to smaller numbers of casualties.
I would train my troops to be more mobile - ie Feat them to get out of the way and make them use move and cover tactics
Real World ex #3 - After WWII it was discovered that if the enemy has a weapon and you can counter that threat, you're a lot better for it and may reduce casualties even more.
My troops would have a cleric for healing (medic) along for the ride and at least one sniper (Archer) to take out the magic threat, this is warfare so poisoned arrows are fair game. An infantry heavy weapons group, (light ballista) to lay down covering fire (like the Romans did in the 400BC - fall of Empire) and possibly keep the wizard at bay is a must.
As for magic items or other such nonsense - troops are expendable they know it and you known it! They get their room and board in exhange for the chance to die for their country! The cost to prevent flame damage is just too great. As an example even the burning pitch dumped on them from above was not a reason to create better PERSONAL equipment - they used seige shields and seige houses to deflect the vile stuff. Much more cost effective and reduced the amount of casualties. If you wanted to a large rolling house covered in wet hides would keep the flame damage from happening, but the explosion would proabaly rip the poor thing apart, so individual tactics is still the most sound idea.
The difference between fiction and fact is that the great generals of the ages adapted their tactics to their enemy. The poor generals wrote a lot of letters to grieving mothers and widows or were beheaded for incompetance. Medieval combat worked with the technology on hand, had magic truly existed, more modern combat tactics would have arisen out of neccessity.