Yeah, I've had that, about 3 times. Once it happens, it tends to happen again. For me, it's usually a pulled muscle and then the whole back starts to spasm. A pulled muscle takes a full month to heal. It sucks.
A physical therapist will help a LOT, try to find a Doctor of PT, they know what they're doing. They can relieve the pain in about a half hour, then repeated sessions will keep it from returning. They will also show you movements to relieve the pain.
Or a hot bath and a lot of Sangria. That works too. The idea is to relax your muscles, because when you think about it, it makes you tense, the more you tense, the more it spasms/hurts. The more it hurts, the tenser you get, the more it spasms. Repeat. So, to break the vicious pain cycle, you need to get rid of the tension.
That's where the Sangria comes in.