The two things that helped my lower back pain were sleeping on the carpet, and arch supports in the shoes. Both were a night a day difference (literally, the next night my back felt better).
A firm surface gives you more support in the night, and arch supports (if you have low arches) help you absorb shock better.
Evidence shows that "too firm" can be as bad as "not firm enough".
I'm not giving medical advice but once you've ruled out scary possibilities for lower back pain (rare but serious) the single most effective thing is exercise to strengthen muscles of the lower back.
Strengthening the back muscles is one preventative cure, but can also aggravate an existing injury or inflammation. First thing is to recover.
Proper diagnosis is also key. In my case, I had joint irritation from flat arches, and also tight hamstrings with a stronger side from sports. My back took a lot of hits over time, and my muscles would pull them out of place.
A firm surface gives you more support in the night, and arch supports (if you have low arches) help you absorb shock better.