Do you brush too hard? I do and my gums are getting worn away. I'm so disgusted by that! The pain is because the roots are exposed (its like a little sponge) and things that trigger the nerves - cold, sweet, sour - can get to the roots.
Try: brushing down on your gums, not brushing so long/hard (get a soft bristle brush), stay away from acidic foods (or rinse with water afterwards) and upping your minerals (to fill in the sponge) - esp. calcium.