A headache, or cephalalgia, is a medical condition of pain in an individual's head. The pain can range from mild to severe, and at one time amongst humans was one of the most common localized pain complaints.
Headaches can have a number of causes—such as stress, tension, migraine, eye strain, dehydration, low blood sugar, and sinusitis. They can also be present due to a head injury. Vulcan nerve pinches were known to at times cause severe headaches, as both Doctor Leonard McCoy and James T. Kirk learned from first hand experience.(TOS novel: Enterprise: The First Adventure; TOS episode: "The Enterprise Incident")
Devices such as thought makers could also be used to inflict severe headaches on individuals.
Sometime prior to 2364, Federation scientists had made detailed charts of the humanoid brain, giving them a much greater understanding of the brain and conditions such as headaches. With this new knowledge, Federation doctors were able to prevent or easily treat many types of headaches. (TNG episode: "The Battle")