i had the exact same thing when i was pregnant! not a nice way to wake up, it is one of the most painful things ive ever experianced!! i would also be screaming + crying!
people told me lots of old wives tales say its because not enough salt in diet, calcium, drink tonic water etc, etc.. but i couldnt find any remedy to stop them. i just became very aware of how i moved and streched my legs in bed. although someone did tell me to put my leg on a cold surface and one morning i hobbled and sat on the bathroom floor with my leg out and that seemed to help.
good news is i havent had any since i had ds, so there is hope yet