Sumatriptan is a medication primarily used to treat migraine headaches. It belongs to a class of drugs known as triptans, which relieve pain by narrowing blood vessels around the brain and reducing substances in the body that can trigger headache pain, nausea, and sensitivity to light and sound. Sumatriptan is effective in alleviating migraine symptoms but is not used for the prevention of migraines.