Losing weight is only part of it, strengthening the supporting muscles and improving posture do wonders for back pain.  I had an accident when I was younger and was in a body cast and it weakened my core muscles, suffered many years of pain, started working out and the pain takes a lot longer to start, is a lot more bearable and relaxes/eases quicker once resting.