Hello Betsy, if your dog is in pain you need to pop her to the Vet and find out what is causing it. If you are certain its her hips she may have Hip Dysplasia which is a whole different ball game.
Any medication you give her needs to be prescribed by a Vet….and only a Vet. She may need x rays too. This really is not something you can treat at home yourself without guidance from a professional.
PLEASE familiarize yourself with the symptoms of Puppy Strangles. Currently going through treatment for it with my puppy. See a vet IMMEDIATELY.