If you are suffering from degenerative disc disease then they say that one of the best positions is to sleep on your stomach as this can relieve the pressure on the disc space. You should then place a flat pillow under your stomach and hips to help reduce stress on your lower back.
If you are suffering from spinal stenosis then try to sleep on your side with your knees curled up in the fetal position. This can help relieve pressure on the nerve root. If you are lucky enough to have a reclining chair or adjustable bed then this can be adjusted so that your head and knees are elevated to relieve the pressure on the nerve.
If you have pain from a herniated lumber disc then the most comfortable sleep position is really dependant on which disc is prolapsed. For a paracentral (the most common) it is better to lie on your stomach and for a foraminal, it’s best if you sleep on your side in the fetal position.
However, in general, elevating the knees slightly by placing a pillow under them while lying on your back can help many general forms of low back pain.
According to bed site Drommabed the best position if you are experiencing upper back pain they suggest you use one memory foam pillow or no pillows under your head. Lie on your side and place a pillow between your knees. Drommabed also has the best positions for lots of different types of pains.