Take an over-the-counter nonsteroidal anti-inflammatory drug (NSAID) like naproxen or ibuprofen two days before you expect your period, when the headache is likely to happen. If you're experiencing headaches during pregnancy, ask your doctor to recommend a pain-relief plan