Getting painful spasms in the leg muscles is common in pregnancy, particularly at night. You may find that you wake up due to the sudden and severe localized pain in your legs or feet. This is thought to be due to the pressure of the uterus on the pelvic nerves.
Some experts believe that cramps during pregnancy may be caused by a lack of calcium or salt or an excess of phosphorus, but these theories are as yet unproven.
When you get a spasm, relieve it by flexing your foot or leg, and gently massaging the affected area. The cramp should resolve itself once you are out of bed and using the muscle. However, if the pain doesn't recede and there is any reddening or swelling in the leg, you should seek medical advice immediately to eliminate the possibility of a clot (see ... Doctor), since this can be dangerous.
To reduce the incidence of cramps or its severity, drink lots of water to prevent dehydration and regularly do leg stretches and ankle exercises, circling your heel and wiggling your toes.
Getting gentle exercise, such as walking or swimming, can also help, as can regularly massaging the calf muscle to improve circulation.