I get this most nights and it's evil.
I have been in chronic pain meds which helped me, though for other pain as well though, and have been trying to cope without them but find I'm having to take pain killers (anti-inflammatories now my tummy have healed itself a bit) anyway and just get less sleep because of it so having a rethink.
I try to keep my legs as cool as possible and keep them raised sometimes, just prop them up on a pillow.
I've heard tonic water is good due to the quinnine but I can't stand the stuff.