Lots of good advice here, but it's best to know the origins of the pain before taking any action.
It could be one of two things: muscular or skeletal.
You could have strained some muscles, in which case, rest, anti-inflamatories, some stretching, etc., are good things to do.
It could be a bulging or herniated disc, in which case some of the stretching might not be a good idea and laying on your back for extended periods of time, like sleeping, is also not a good thing.
The problem is, at first you won't know the difference. It just hurts. But as things start to settle down, the hurt will be different. If it's a disc, it will be touching on a nerve. When that happens, you will likely develop pain in some other area, like your legs (especially since the problem is in the lower back). The nerves being irritated go somewhere else, like your legs, but the irritation is received by your brain as a pain in your legs, for example. If it's just muscular, the pain should subside over time with no other pain anywhere.
If it's a disc, sleep on your side with a pillow between your legs. This keeps your spine as straight as possible, reducing the movement of the disc and therefore the irritation of any nerves.
Ask for an MRI. This will reveal whether it's a disc or not. Muscle strains will get better in a fairly short amount of time. But if you go a month without getting better, it may very well be a disc. Get the MRI.
I strained my back in 1992. I went through all the therapies as though it were muscular but it never got better. I finally visited a neurosurgeon who ordered the MRI that revealed I had two bulging discs, one worse than the other. I had pains up and down my legs, wrapping around from the front of the thigh to behind my knee, back around to the front of the shin and the top of my foot. All on the left leg. Coughing or sneezing was the worst.
I had surgery to repair the discs that summer and I haven't had any problems since. As I laid on the gurney while they prepped me for surgery, my left leg was killing me, laying there on my back. When I woke up later, the first thing I remember thinking was that my leg didn't hurt anymore.
That was my experience. Best advice is to find out what's really wrong. Being sent home with muscle relaxers and pain meds isn't a diagnosis. If they get it wrong and you do the wrong things, you'll be in more pain for a longer period of time. Get a proper diagnosis so you can treated properly.