Exercising/Massaging the muscle that's cramping is always the best way to relieve the cramp, so sex or any other vaginal related activity that brings about pleasure should relieve the cramping.
Isn't sex during a woman's period also the time a woman is least likely to get pregnant?