I had a problem with my back a couple of weeks ago, resulting in my being unable to get out of bed for over a week. Basically my problem was inflamed discs which also cause the muscles to spasm to protect your spine. It was excruitiating, I literally could not move.
However with back pain you shoulsd put ice pack on for as long as you can bear to reduce the inflammation + ibubrofen (sp) which is an anti inflammatory, then apply heat - either a heat pad or a hot water bottle - to let the warmth relax the muscle spasm.
I would also recommend a visit to a physio or a osteopath, they use a combination of gentle manipulation and massage to set you right - if it is a disc that requiress a consultant they will recommend that too.
(One word of 'warning' after a visit to osteo/physio you will often feel slightly worse as the bones/muscles have to readjust, this is perfectly normal and you'll feel better the following day for sure)