Upper back pain that appears or worsens when you lie down usually stems from how the thoracic spine, its surrounding muscles, and the rib cage respond to the shift from upright to horizontal. The causes range from tight muscles and stiff joints being compressed against a mattress to less obvious factors like how your rib cage moves during breathing in a supine position, or even referred pain from the heart’s lining. The specific trigger matters because some causes respond to a simple pillow adjustment while others warrant a trip to the doctor.
What Changes When You Go from Upright to Flat
When you stand or sit, gravity pulls straight down through your spine, and your postural muscles actively work to keep everything aligned. The moment you lie on your back, the load distribution shifts dramatically. Your thoracic spine, which has a natural outward curve (the kyphosis), is now pressed against a flat surface. If that curve is pronounced, the contact points concentrate pressure on certain vertebrae and the muscles around them. Side-lying redistributes that pressure but introduces its own asymmetries, particularly through the shoulder and rib cage on the down side.
The rib cage plays a bigger role than most people realize. A biomechanical study modeling chest breathing in the supine position found that the movement of the rib cage during normal breathing stretches the abdominal wall muscles both horizontally and vertically through their tendon connections to the lower ribs. The chest’s front-to-back and side-to-side diameters change with each breath, and the external intercostal muscles in different regions of the rib cage have different effects on rib motion during respiration.1PubMed Central. Thorax Dynamic Modeling and Biomechanical Analysis of Chest Breathing in Supine Lying Position What this means practically is that lying flat changes not just how your spine is loaded, but how your entire trunk moves with every breath. If any of those rib or intercostal structures are irritated, even quiet breathing while lying down can produce or amplify upper back discomfort.
Muscle Tension and Trigger Points
The upper trapezius muscle, which drapes across your upper back and shoulders, is one of the most common culprits. When you sit at a desk, drive, or hunch over a phone for hours, the upper traps stay partially contracted. Over time, localized knots called myofascial trigger points develop, small patches of muscle that are tighter and more tender than the surrounding tissue. You might not notice them much during the day because movement and distraction mask the discomfort. But when you lie down and that tense muscle is compressed between your body weight and the mattress, the pain can become suddenly obvious.
Research on upper trapezius trigger points has shown that the tissue in these knots is measurably harder than normal muscle and has a lower threshold for pressure-induced pain. Physical therapy targeting these points (through manual pressure, stretching, and strengthening) can reduce tissue hardness by around eight percent and improve pressure tolerance, with those improvements correlating with better neck function scores.2PeerJ. Reliability and responsiveness of a tissue hardness meter and algometer for measuring tissue hardness and pressure pain threshold in upper trapezius myofascial trigger points The practical takeaway is that if your upper back pain when lying down is muscular, it tends to respond well to hands-on treatment and postural correction during the day, not just to changing how you sleep.
Beyond the traps, the rhomboids (between your shoulder blades) and the paraspinal muscles along the thoracic spine are frequent offenders. These muscles can develop similar trigger points from sustained poor posture or repetitive overhead activity. The pattern is consistent: daytime tension, nighttime compression, and pain that seems to come out of nowhere when you finally rest.
Facet Joints and Thoracic Disc Problems
Your spine isn’t just a stack of bones cushioned by discs. Each vertebra connects to its neighbors through small paired joints called facet joints, and these can become a significant pain source. Thoracic facet joint pain accounts for roughly 42 percent of chronic thoracic spinal pain syndromes, according to prevalence data on facet-related conditions.3PubMed Central. Facet joint disorders: from diagnosis to treatment Degenerative changes like osteoarthritis, overgrown joint surfaces, and cysts can all irritate these joints. When you lie flat, the thoracic spine extends slightly compared to sitting, which shifts load onto the facet joints in a way that can provoke pain in people with facet arthropathy.
Thoracic disc herniations are less talked about than their lumbar counterparts, but they do occur and can be stubbornly painful. A case series of patients with persistent upper back pain after motor vehicle collisions found that thoracic disc herniations were the underlying cause, even though the patients had improved in every other respect. Most of these herniations were small to medium-sized, located near the apex of the thoracic curve, and partially calcified.4PubMed. Crippling upper back pain after whiplash and other motor vehicle collisions caused by thoracic disc herniations: report of 10 cases The location matters: the apex of the thoracic kyphosis is the point of greatest curvature, and it bears the most mechanical stress when you lie on your back. A disc problem here can simmer unnoticed during the day and flare when that spot is loaded against a mattress.
Facet joint problems and disc issues also occasionally produce pain that radiates around the rib cage or between the shoulder blades in ways that mimic other conditions. If facet cysts or overgrown joint tissue compresses a nerve root, the pain can travel along the path of an intercostal nerve, wrapping around the chest wall.3PubMed Central. Facet joint disorders: from diagnosis to treatment This can be confusing because it feels like a lung or heart problem rather than a spine problem.
Mattress Firmness and Sleep Position
Your sleep surface has a surprisingly strong influence on whether the thoracic spine is supported or stressed. A systematic review of the mattress literature found that a medium-firm mattress generally promotes the best spinal alignment, comfort, and sleep quality. A mattress that’s too firm doesn’t let the shoulders sink in enough, which fails to support the neck and upper back and leads to pain and stiffness. One that’s too soft lets the hips and shoulders sink too far, pulling the spine out of alignment.5PubMed Central. What type of mattress should be chosen to avoid back pain and improve sleep quality? Review of the literature For the upper back specifically, the shoulder-sinking problem on firm mattresses is the more relevant issue. If your shoulders can’t settle into the surface at all, the thoracic spine is forced into a flattened position that loads the facet joints and compresses the muscles unevenly.
Body composition also plays a role. Research using muscle activity sensors found that people with a higher body mass index, larger waist circumference, and more balanced weight distribution between upper and lower body showed less residual muscle tension on firm mattresses, suggesting firmer surfaces suit them better. For the general population, though, the medium-firm option again produced the lowest discomfort ratings overall.6PubMed Central. Surface Electromyographic Responses During Rest on Mattresses with Different Firmness Levels in Adults with Normal BMI The implication is that “the right mattress” isn’t universal, and a mattress that works for one person’s build can be the wrong choice for another’s.
Sleep position matters independently of the mattress. A scoping review of sleep posture and spinal symptoms found that sleeping on your back increases the risk of developing lower back pain by about 1.9 times, while side sleepers were significantly less likely to report waking cervical pain compared to people who slept in any other position.7PubMed Central. Identifying relationships between sleep posture and non-specific spinal symptoms in adults: A scoping review Although the study measured cervical and lumbar symptoms more directly than thoracic ones, the mechanical principles extend to the upper back: back sleeping flattens the thoracic curve against the mattress, while side sleeping offloads that region. People who sleep in an upright or semi-upright position were the most likely to report waking symptoms overall, probably because the spine never fully unloads.
If you’re a back sleeper experiencing upper back pain, a thin pillow or rolled towel placed under the thoracic curve can help restore a more natural spinal contour. Side sleepers benefit from a pillow thick enough to fill the gap between the mattress and the neck, keeping the cervical and upper thoracic spine aligned rather than kinked sideways.
When the Cause Isn’t Your Spine at All
Not all upper back pain originates in the musculoskeletal system. One condition that specifically worsens when lying down is pericarditis, an inflammation of the sac surrounding the heart. The hallmark symptom is a sharp chest pain that gets worse with coughing, lying flat, and deep breathing, and it frequently radiates to the neck, shoulders, or upper back.8Myocarditis Foundation. Recurrent Pericarditis People with pericarditis often discover they can only get comfortable by sitting up and leaning forward, which takes tension off the pericardium. If your upper back pain when lying down came on acutely, is accompanied by chest tightness or sharp chest pain, and improves when you sit up, this is worth having evaluated promptly.
Other non-spinal sources of upper back pain at night include gastroesophageal reflux (acid backing up into the esophagus, which shares nerve pathways with the upper back), gallbladder disease (which can refer pain to the right shoulder blade area), and, rarely, conditions like aortic dissection or pulmonary embolism. These are worth mentioning not to cause alarm but because the positional pattern of “fine during the day, painful lying down” can mislead people into assuming the problem is always muscular.
In primary care settings, between one and five percent of patients presenting with back pain have a serious underlying condition. Cancer is the second most common serious diagnosis mimicking back pain, with a prevalence of up to about two percent, behind spinal fractures at up to about seven percent.9PubMed Central. Diagnostic Utility of Red Flags for Detecting Spinal Malignancies in Patients with Low Back Pain: A Scoping Review Those numbers come from low back pain data specifically, but the principle of screening for red flags applies across the spine. Pain that wakes you from sleep (rather than just being present when you happen to be awake and lying down), unexplained weight loss, a history of cancer, fever, or pain that relentlessly worsens over weeks regardless of position all warrant medical evaluation sooner rather than later.
Why Pain Perception Shifts After Dark
There’s a separate layer to this question that has nothing to do with spinal mechanics: your body’s pain processing system actually works differently at night. A review of circadian rhythms and pain found that pain sensitivity fluctuates throughout the day, driven by rhythms in the descending pain-control pathways, the opioid system, the endocrine system, and the immune system. There isn’t a single brain region acting as a “pain clock.” Instead, the daily ups and downs of pain are the combined product of rhythms distributed across all of these systems.10PubMed Central. Circadian rhythms and pain For many types of pain, the body’s natural pain-suppression mechanisms are at their weakest in the late evening and early morning hours, which is exactly when you’re lying in bed.
This means that some of what feels like “lying-down pain” is really “nighttime pain.” The same amount of inflammation or joint stiffness that you barely register at 2 p.m. can feel much more intense at 11 p.m., simply because your internal pain-dampening chemistry has cycled down. It’s not imaginary. The stimulus may be the same, but your threshold for perceiving it as painful has genuinely dropped.
Compounding this, poor sleep itself makes pain worse, and pain disrupts sleep, creating a feedback loop that can be difficult to break. A systematic review examining the relationship between sleep and chronic spinal pain found weak to moderate evidence that the two are bidirectionally linked: more severe pain was associated with more disturbed sleep, and poorer sleep predicted worse pain.11PubMed Central. The Association between Sleep and Chronic Spinal Pain: A Systematic Review from the Last Decade If your upper back pain has been going on for weeks, the pain and the sleep disruption may be reinforcing each other even if the original mechanical trigger is relatively minor. Treating the pain alone without addressing sleep quality (or vice versa) often leaves people stuck in the cycle. This is one reason why people with chronic back pain sometimes find that cognitive behavioral therapy for insomnia or structured sleep hygiene interventions improve their pain, even though those approaches don’t directly target the spine.
The practical implication is that if you’ve been dealing with nighttime upper back pain for a while and stretching, mattress changes, and position adjustments haven’t fully resolved it, the sleep-pain loop itself may be part of what’s keeping the problem alive. A sleep medicine evaluation or a pain management approach that explicitly addresses sleep can sometimes accomplish what purely musculoskeletal treatments have not.