Whenever I get any pain in my gums I mix some salt with warm water and rinse my mouth out with the warm salt water.
I gargle the salt water like I would mouthwash. I don't know why but the warm salt water helps with the gum pain.
Also brushing your teeth with toothbrushes that have soft bristles help alleviate gum pain as well.
If the pain in the gums gets worse or doesn't go away then you could have a serious infection of a tooth or gums and need to see a dentist.