Provided herein formulations of capsaicin for delivery by nasal route and methods of using the formulations for the treatment of migraines and other severe headaches. The formulations described herein contain mucoadhesives to optimize the therapeutic effect of capsaicin by intranasal delivery.