Firstly you need to ID what the mage is using...then you can use the right tool. I assume you are having trouble hitting them in melee combat so you need to hit them with spells that remove melee protections. Here is a quick list with the spell level of the counter as well:
Stone Skin - probably the most common one you'll encounter (and use). Hit it with Breach (5) and it'll come right off. Watch out for recasts though...
Protection From Magical Weapons - another common one, and usually used at the same time as Stone Skin. Dispel / Remove Magic (3) can work on it but it's a bit random. Better to use something like Secret Word (4) on it or just switch to non-magic weapons once you have got rid of any Stone Skins on that mage.
Improved Invisibity / Mislead / Project Image - very common and annoying as it'll likely stop you from targeting them with magic. True Sight (6) is king here as it lasts a number of rounds and should cut through anything unless they have a Non-Detection spell up as well (which I've never seen anyone use).
Spell Immuity - this one is the evil one, but I don't think it's used in an unmodded version of the game. There is little you can do if they can protect themselves from both Diviation and Abjuration as that'll block both anti invisible spells and most anti magic spells as well. You'll have to run the clock down on them, so either get out of line of sight or use a group invisiblity spell on your party. Area effect attacks should still work and I *think* dispel on hit stuff as well but don't quote me on that...
Spell Shield - somewhat uncommon, but can be annoying as it'll eat the first anti magic spell you fire at it and then die. If you see an enemy with one, just fire any low level anti magic spell (like Spell Thrust (3) or Secret Word (4)) at them to get rid of it before you use other more important ones like Breach (5)...
Spell Trap - again rare. but liches like to use them (and they are immune to level 5 and lower spells except Dispel / Remove Magic (3) that isn't directly targeted on them). Best bet is to use a Ruby Ray of Reversal (7), Pierce Shield (8) or Spell Strike (9) to being it down...don't cast anything else at it until it is down though!
Hope that helps...