In addition to taking rx muscle relaxants, I find the Voltren gel helps a bit too when they're really bad. And though heat and ms don't play well, I still keep a heating pad beside the bed and one near the couch for when they're kicking up a fuss. Low heat, light stretches and deep breathing to try and ride it out. I have a TENS unit as well if they seem to be more than all that can handle.
Sometimes episodes of intense spasms last 20-30 minutes, sometimes longer, and occasionally lasting into insanity inciting endless hours of body ripping pain (my own personal front row seat of hell) to which no drugs, heat, stretch, breath or jolts of electricity will save me from. But.... Joys if MS I guess
I suppose at those times I should go to the ER, but we have a really crappy ER where I'm at, they'd probably dx me with a mosquito bite and send me home with anti-itch cream, if that was the disease of the day on their calendar.
There are also some massages you can do, that fall in line with stretching the muscles. But the Voltren seems to help me the most at night, applying it before bed on the notoriously spastic muscles and I can generally make it through the night, especially if I do the massages while applying the gel.