If the pain is so bad that you can't stand up straight you need to see a doctor. They will probably prescribe muscle relaxants and pain killers which will make it easier to do some simple stretches and maneuvers to lessen the pain.
I have (unfortunately) injured my back numerous times and can usually do stuff at home to get myself back on track unless it gets to the point you're describing. They may also be able to provide you with some exercises to do. Whatever you do, DON'T just lie around and hope it will get better on its own. Walking definitely helps. Also, you can lie down on the floor, and put your legs on a chair to help take the pressure off your lower back (quads are perpendicular to the floor, knees bent 90 degrees, calves parallel to floor and fully supported by chair/couch). Bridges are also a huge help for me. Here's a good video on how to do them.
http://www.youtube.com/watch?v=iHyh4ehyVY0&feature=youtube_gdata_player