It could be lack of potassium or magnesium. They usually go hand-in-hand. You can either up the veggies that have these vitamins or you can take suppliments around bed time. I still get these on occasion when I forget to take those sups. Best way when you do get them is to stand up, the pain goes away fast.