A few things can help. A bit of exercise before bed can help if you're up to it, keeping your legs warm and not letting them get chilled, magnesium works for some (buy it over the counter), tonic water helps some. But if they don't respond to those things, seeing your doctor and asking for something like Zanaflex or Baclofen. If you take one of the drugs for spasm, start off slowly as they can be quite sedating. I have MS and use Zanaflex 4 mg., but I will take half a pill i.e.2mg. and then the other half if that doesn't settle the spasms. I don't like the drugged dopey feeling. And I think the increasing fluids advice is very good.
Quinine was the only think that helped my mam, they had to be prescribed here. She likes the odd drink so on her doctors advice, she started drinking, Vodka and tonic water (contains quinine) dont know if it was the vodka or the quinine but it worked! She slept much better at night...