The review is devoted to the complex relationship between headache and sleep disorders. The shared neuroanatomical structures of the nervous system involved in pain perception and sleep are shown, and mechanisms of comorbidity between headaches and sleep disorders are considered. Various types of headaches in the continuum of the sleep–wake cycle are described. Both pharmacological and non-pharmacological approaches to treatment are examined in detail, with the biochemical basis of the drug action.