Patients with chronic daily headache and overuse of analgesics, triptans, or other acute headache compounds, are considered to suffer from medication-overuse headache (MOH). This implies that medication overuse is the cause of headache chronification. It remains a key question why only two-thirds of patients with chronic migraine-like headache and overuse of pain medication improve after detoxification, whereas the remainder continue to have chronic headache. In the present longitudinal MRI study, we used voxel-based morphometry to investigate gray matter changes related to medication withdrawal in a group of humans with MOH. As a main result, we found that only patients with significant clinical improvement showed a significant decrease of previously increased gray matter in the midbrain including periaqueductal gray matter and nucleus cuneiformis, whereas patients without improvement did not. Patients without treatment response had less gray matter in the orbitofrontal cortex. Another striking result is the correlation of treatment response with the amount of orbitofrontal gray matter. Thus, we demonstrate adaptive gray matter changes within the pain modulatory system in patients with MOH who responded to detoxification, probably reflecting neuronal plasticity. Decreased gray matter in the orbitofrontal cortex at baseline may be predictive of poor response to treatment.