Long ago, Shaman were considered the most overpowered class in the game by the average forum-goer.  That has since been generally changed to warlocks, and instead shaman are often considered "the most broken".  Against a mage, certainly, shaman tend to stand little chance if the mage plays their cards right.

The three specs are fairly different to tackle.  Elemental shaman have nasty spell damage and burst from range.  Enhancement shaman will tear you up if you let them get close enough.  Restoration shaman just... won't... die.  Fortunately all three can be handled with various approaches.

For Elemental shaman, the general idea is to simply shut off their nature school.  The bulk of their damage will come from Chain Lightning, Lightning Bolts, and Earth Shock.  Counterspelling a Chain Lightning will completely shut down all their damage capability (and healing capability!) for 8 seconds.  If you don't think you can kill a shaman in 8 seconds (an extremely well geared one may have more health than you can eat through that fast depending on your spec), you may want to rough them up a bit before attempting to CS, then unload with your burst damage.

For Enhancement shaman, the general idea is to stay the hell away from them.  This is extremely easy as a mage.  Grounding Totem is obnoxious, but remember that it won't stop Frost Nova and Cone of Cold.  If they trinket out of frost nova, trinket out of frost shock, ice lance earthbind if it's out, and Cone of Cold them.  Once you get distance, you can try to sheep to get even more and begin to kite them just like you would a warrior (without intercept, but with grounding totem and earth shock).  As long as you stay away, you can generally instant cast an Enhancement shaman to death.

For Restoration shaman, you're in for the long haul if they're well geared.  The general idea here is to try and get them to burn Nature's Swiftness, and THEN unload all your burst.  Whittle away at them as best you can until they get low (CS a heal early to make them panic when the CS wears off), at which point they'll probably try to burn Nature's Swiftness.  After they do so, sheep them, smack them around a bit (to 50-75% depending on how well geared they are), then completely and utterly unload with everything you've got.  Remember to Spellsteal Earth Shield, as it costs them even more mana to cast that then it costs you to Spellsteal (if you can believe that) and it'll essentially kill off their healing with a well timed CS.  One thing that's been pointed out to me is that the shaman will almost certainly have better mana regen than you.  Still, most shaman will be gunshy on recasting earth shield after you steal it, and most shaman won't be well geared enough in mana regen for it to make much of a difference.

I'd also like to recommend the ice lance mouseover macro (see macro section).  You can use this to mouse over a shaman's totem and kill it without having to retarget the shaman.

That was quite a bit of info, but let's look into a shaman's repertoire a bit more in depth.

Earth Shock

Cooldown: 6 seconds

Duration: 2 second interrupt

Range: 20 yards (25 with Elemental PvP gloves)

Earth Shock is obnoxious as anything unless you play around it.  Fortunately, there are a few things you can do to counteract it.  First, remember its cooldown (and that it's only 5 seconds with Elemental talents!).  If they use it on you once, you've got at least 5 seconds to cast something else.  You can also fake a cast by starting to cast something, then immediately cancelling it.  If the shaman earth shocks you in reflex, you're clear to recast the spell for real.  You can also try to bait them into earth shocking a different school.  For example, frostbolt into an earth shock, then immediately polymorph them.

Earth Shock also shares a cooldown with Frost Shock and Flame Shock (though if a shaman is using Flame Shock against you, you probably don't need to be reading any of this, but Frost Shock will be used for sure).  If a shaman Frost Shocks you, you're free to cast without fear of Earth Shock for at least 5 seconds.

The 20 (or 25) yard range means you can stay far enough away that they can't actually shock you.  If you can find a nice sweet spot at around 30+ yards, you can kite the shaman and only worry about grounding totem messing up your casts.  This can be tricky to sustain, but is definitely worth keeping in mind.

Grounding Totem

Cooldown: 15 seconds

Absorbs one spell every 10 seconds (but is destroyed if that spell deals damage)

This is what you'll really have to dance around as a mage.  Smart shaman will place it just as a spell is going off, and will often place one before trying to heal.  If the totem is out when you Counterspell, it will eat the Counterspell and the shaman is free to heal to full.  To counter this, use Fire Blast every time just before you Counterspell.  This will kill the totem instantly (Ice Lance has a travel time) if it's out, or just smack him if it isn't.  For this reason, you should save Fire Blast against a shaman until you're about to CS (use it as normal when CS is on cooldown, obviously).

Purge

Removes up to two buffs on the target

This will get rid of Arcane Power, Combustion, and Ice Barrier.  Yes, a trained class skill can counteract every one of our 31 point talents.  This is a bit misleading, though, as each of these talents can still be used against a purge-happy shaman.  For example, Arcane Power and Combustion should be used after you CS their nature school through a lightning attack or a heal.  Purge is a nature spell as well, so a CS'd shaman can't purge off your big burst for a full 8 seconds.  Ice Barrier can be timed to go up just as a spell is about to hit.  Save it for when they start to cast Chain Lightning, and if for any reason you don't want to or can't CS it, pop Ice Barrier just before it goes off.  It will absorb a lot of the damage as the shaman can't purge before you're hit.

Remember, don't use your big stuff until you're sure it'll hit!

Nature's Swiftness

Cooldown: 3 minutes

Makes the shaman's next nature spell instant 

21 point Restoration talent

Basically a shaman PoM, they can use this either defensively (with an instant big heal) or offensively (with an instant lightning bolt).  A very large amount of shaman will take this talent, so it's safe to assume every shaman you run into has access to it and play accordingly.  If they pull of a NS+heal after a CS wears off, polymorph them and let your CS cool down before re-engaging if possible.  For elemental shaman, watch out for a Chain Lightning -> NS Lightning Bolt -> Earth Shock damage combo, as it will take out a HUGE chunk of you're life and give you almost no time to react.  However, if they do this, remember that they can't pull this off again for the rest of the fight.