My right leg was shattered just below the hip about 5 1/2 years ago. I have constant pain issues, which also have made sleeping rough. I used 50mg of Diphenhydramine (Benadryl) for awhile. It definitely helps me to fall asleep, but doesn't help me stay asleep through the pain.
A few months ago, my Doctor gave me a script for Lunesta. It has really helped me. I don't take it every night, but the nights that I do take it it definitely makes a difference.
As for cost, 30 doses costs me $30, but I'm not sure how much of the cost is covered by my insurance.