When you are trying to sleep, you are trying to balance both resting comfortably and assuming a posture that will prevent further pain and soreness. As such, what position you assume while asleep is highly essential.
Generally speaking, sleeping on your stomach is not advisable. The position naturally puts undue weight on your back and neck. However, if you gravitate toward this position or it helps with your particular condition, then you can provide support by placing a pillow under your lower abdomen to distribute the weight more evenly.
If you sleep on your side, you might want to consider placing a pillow between your knees. Without a pillow or similar support in that position, your spine and hips may hang and bend unnaturally throughout the night. Using some form of pad to space your legs out will promote better alignment of your body. Because sleeping on your side is inherently asymmetrical, take care not to favor one side night after night. Alternate to prevent uneven muscle development.
If you sleep on your back, try putting a pillow underneath your knees. This can help take the weight off of your lower back and have your spine extend more naturally while you sleep.
One common theme throughout all of these solutions is that they focus on the alignment of your spine and even weight distribution throughout your body. Even though we may not think of it often, keeping this sort of balance is crucial if you are maintaining a certain sleeping posture for perhaps eight hours a day. Though it can be difficult to monitor yourself, excessive tossing and turning can alter your posture and lead to pain during the day.