It does sound like a charley horse - they can sometimes be excrutiating! And sooo frustrating as they do quite often hit just as you're falling asleep.
The cause could be low potassium as ashleyanne suggested - try increasing your potassium intake a little to see if it helps. It could also be caused by dehydration - even slight - so make sure you are drinking plenty of fluids, especially water.
A charley horse can also happen from overuse of the muscle. Have you changed your exercise routine lately? Exercising close to bed time?
I've never heard of the lip suggestion that ashleyanne had, but I have heard about and used the putting your foot on a cold floor to help relieve them. Somthing else you can try even before you get out of bed (if yours are like mine sometimes they are so bad that you CAN'T stand on the affected leg) - point your toes up toward the ceiling - either by pointing them on their own, or if you need to, using your hand to pull them up. This will stretch out those muscles in your leg and help to release the charley horse. Sometimes you will have to do this a few times. Sometimes when I get them, I'll do this and it will feel better, but the minute I release my toes, it comes right back, so I have to stretch it out a couple more times before I'm finally able to get up and wlak on the cold floor.
I hope some of these suggestions help.
Its called a charlie horse. It means you need more potassium in your diet. If it happens get up and put your foot on the cold floor. Also this sounds weird but pull your bottom lip out and shake it. Sounds crazy but it works.