I sometimes get cramps in my lower legs when in bed. However, if I point my toes upwards, towards my leg, as if I'm trying to touch my shin with my toes, it stops the cramps immediately. Try it, I'd love to know whether this works for you or if it's just one of my peculiarities (I've got lots).
;-)).