How much pain are you in, how long has it been going on? Is it upper or lower, on one side, all over? Is it from exerting yourself (exercising, lifting something heavy, mowing lawn, etc) or did you maybe sleep in a weird position? Is your bed mattress in good shape? You don't have to post the answers here if it's personal, but those are some things to consider. If it's been more than a few days, or if you get worse, I'd go to an urgent care type clinic (usually cheap with and without insurance) to see if it is serious
I'm not any kind of medical professional, but I recently had an issue with muscle spasms in my left hip from overdoing it playing outdoors...some of the general advice I received (after receiving a few shots and an rx for muscle relaxers) was to
-Keep moving, don't let your muscles become stiff.
-Take a shower and alternate between real hot and real cold water
- use ice/hot pad for 15-20 minutes at a time