I get this question all the time. Unfortunately, the answer is complicated.
Wouldn't that be nice, if there was an exercise we all knew that we could do that would make our back pain better? And certain current affairs TV show stories might give you the impression that there are 'miracle cures' for back pain simply by doing a particular exercise.
But back pain is more complicated than that.
Depending on exactly what is causing and/or contributing to your back pain, certain exercises might make it better or might make it worse. (Note: Just because it makes your pain worse DOES NOT MEAN that it is causing tissue damage or worsening an injury)
On the plus side, general exercise is good for pain in general, including back pain. But while walking or running might work to relieve many peoples' back pain, if your back pain is sensitive to extension load then these activities might make it worse. In this situation cycling, walking in a pool or using an elliptical cross trainer might be alternatives.
Stretches and range of movement exercises are helpful to relieve back pain that is associated with stiffness and muscle tightness, however the positions you have to get in to perform some of these exercises may aggravate your back pain if it is particularly irritable.
The exercises that are most "good for back pain" are ones that address the particular factors causing or contributing to your back pain. Prescription of these exercises should be tailored to the individual based on a thorough subjective and objective assessment of your condition. In the past, physios have been quite generic in their prescription of pilates-type exercises for the treatment of back pain through improving "core stability" but more recent research has found that this is not nearly as effective as an individually tailored rehab program based on a patients particular presentation.
So that's a more complicated answer than people are generally looking for when they ask the question "what's a good exercise for back pain", but that's the truth.
Some simple things you can take away from all this.
General exercise is good for preventing or reducing pain generally, including back pain.
General back stretching and range of movement exercises will help reduce feelings of stiffness and muscle tightness.
If certain exercises are aggravating your pain, slight changes may be able to be made, or alternative exercises found.
Ongoing low back pain benefits from a thorough assessment from a physiotherapist and a tailored rehab program focusing on addressing the causes and contributing factors.