The disclosure is directed to compositions and methods of treating or preventing headaches, including migraines. The compositions comprise a nitrate anion source, an elemental metal (uncharged), and an acid. The compositions are preferably administered orally. In some aspects, the product of a reaction of the nitrate anion source, the elemental metal (uncharged), and the acid are administered to the subject via inhalation.