In addition, aspirin and other nonsteroidal anti-inflammatory drugs (NSAIDs), such as ibuprofen, can have serious side effects, including stomach or intestinal pain or bleeding and ulcers.If OTC pain relievers do not help, your doctor may prescribe a prescription medication to reduce the severity and frequency of your headaches.