According to the Centers for Disease Control and Prevention (CDC), breathing in wildfire smoke may cause headaches immediately. Short-term exposure to particulate material from wildfires is also linked to an increased number of emergency room visits for headaches.

Researchers aren’t sure why wildfires cause headaches. However, it may be because they alter the sensitivity of some neurons, which can increase headache risk, said Dr. Raj Fadadu. He is a researcher from the University of California San Francisco School of Medicine, who has studied wildfire smoke’s health effects.

Dr. Panagis Galiatsatos is a pulmonary and intensive care medicine physician at Johns Hopkins Medicine. He said that wildfire smoke can cause lower oxygen levels in the blood if you suffer from an underlying lung disease like asthma. This can lead to headaches. Inhaling smoke from wildfires can also cause inflammation, which in turn can cause headaches.

Dr. Fadadu said that if you feel a headache coming, you should go indoors if you are in an area of poor air quality. He said that to avoid headaches and other effects of smoke, you should limit the time spent outdoors and improve the quality of the air inside. You can benefit from an air purifier with a HEPA-filter. You should also avoid smoking or vaping.

If you must go outside, wear a mask that fits snugly, such as an N95. While wearing a face mask indoors to reduce smoke is not recommended, if you feel you are in poor air quality and believe you may be inhaling polluted, air, then a mask could help alleviate headache symptoms.

Over-the-counter pain relievers like Tylenol and Advil may be helpful. Dr. Fadadu says that staying hydrated is important. Avoid looking at screens if you can. At the very least, reduce the brightness on your screen to ease strain on your eyes. If your headache does not respond to home treatments or becomes more intense, it may be time to visit an urgent care center, or emergency department. A doctor may prescribe stronger pain medications.

Dr. Galiatsatos suggested that if you have underlying pulmonary problems and are experiencing headaches after exposure to smoke from wildfires, you should consider testing your oxygen level and contacting your physician.

Stress could also be a cause of your wildfire-smoke headache. Stress can cause tension headaches. These are mild, throbbing headaches that usually affect both sides of the brain.

Dr. Fadadu explained that the anxiety people might feel when they see the orange-tinged smoke or decide whether to wear a mask to leave their homes could contribute to headaches. This is especially true on the East Coast where people aren’t used to dealing with the impact of wildfires.

Dr. Fadadu stated that “that ecological stress we’re experiencing with wildfires” is a real phenomenon.