That is the worst!!!
I swear there is nothing worse than not being able to sleep, for whatever reason!!
I have a pair of tube socks that I filled with rice. I microwave them for about 4 minutes and it makes them nice and warm, then I put them wherever I hurt. Sometimes I'll use them at bedtime, other times I'll use them during the day - they feel great on my sore back, hips, ribs, even my belly muscles feel so much better with some heat. If you don't want to resort to medication, I've found this to really help.
That said I've had chronic insomnia for years and fortunately there are some over the counter things I can use that are safe in pregnancy/nursing... without them I would be on antidepressants because I just cannot function with too little sleep...