Potassium does wonders for the pain. It's usually muscle cramps or spasms. Eat a banana or two an hour or two before bed, or at lunch at peanut butter and banana sandwich. I've grown up with leg muscle issues. Especially at night.
My legs have started to hurt alot last week too, specially at night. It is painful to turn in bed....