Hip Pain while sleeping

Does anyone else get really bad hip pain from sleeping? Normally I am a back sleeper but I hit the stage where my doc told me to stay on my sides. I find I wake up and both hips are throbbing all day from me tossing back and forth all night on either one. I have tried putting a pillow between my legs bit it seems to be the outsides of my hips im having trouble with. Any suggestions would be great!