Long post alert.
I used to have alot of back pain while programming and it was mostly due to mean hunching forward. Usually back pain is a result of an excess of stress on the muscles or bad posture.
The first thing i did was to ensure i sat more upright in my chair. This involved me adjusting the placement of my keyboard and mouse so i did not need to lean to it.
I also started using a Trackball Mouse and i know your saying what does that have to do with my back. Well moving my mouse around all the time caused me to lean and get out of the position i had put myself in. It is also so much better on your hand when you get used to it, i also used to have alot of hand pains. Those are now gone.
The next thing i did was to adjust my monitor height. Most ergonomic guides tell you to have your monitor tops at eye level, well that caused me to want to lean forward. So i made my monitors where my eyes were around the middle of the screen, this helped me to not want to lean forward so i would stay level with my monitors.
Next i got a footrest. footrests There are many on that site. By putting my feet on them it is not only very comfortable for my legs and feet, it seems to encourage me to sit up straight.
Last but not least, get up move around and stretch once in awhile. I know it breaks the zone but your sore back will break it even worse. Once your back is sore it will not go away soon, it needs time to recover. So by taking 5 minute breaks every hour or two and doing a little moving and stretching you will give your back the break it needs.
Of course all of those are the things i did and they worked for me, it may or may not work for you.