Learn how to relieve upper back pain while sleeping with these helpful tips. Get the best mattress and pillow for support, sleep with a pillow between your knees, avoid sleeping on your stomach, use a heat or cold compress, try gentle stretching before bed, and incorporate yoga poses into your pre-bed routine.