Stretching or massaging the muscle will usually release the cramping associated with a charlie horse. Be sure to stretch slowly to allow the muscle spasm to release. Heat may also help if the cramp is particularly severe.
Massage the area, this will get the blood flowing again and should also ease some of the pain. Try no to use the muscle until the spasm is over, and once it has ended try flexing the muscle to get it going again
Iodine deficiency can cause charlie horse cramps. Quinine (found in Canada Dry or Schweppes Tonic Water) causes immediate release of charlie horse cramps - however, use sparingly because over time (3..4+ years of weekly use) the effect of quinine diminishes.
The best way to relieve pain from a charlie horse is to drink water. Taking pain medication can also help. Increase potassium intake to avoid future charlie horses.
For immediate relief of a charlie horse, I squeeze my upper lip very hard. Although it does not work for everyone, it does work quite effectively for me. For more long term effects, I find streching and drinking water helps.