What do I do about a bad sunburn and headache?

Several things. Acetaminophen (tylenol) up to 1000mg every 4-6 hrs or Ibuprofen (motrin, advil) up to 800mg every 6-8 hrs are safe for short-term pain relief in healthy adults. Aloe vera or other otc cooling sprays and gels can soothe sunburn - use as often as needed. Dehydration will make both headache & sunburn worse, so drink lots of fluids. If not improving within 48 hrs, see your doctor.
Ouch !!! I agree with dr. Quarles. Aloe vera (aloe barbadensis) can reduce redness, pain, itching & swelling from a burn. It has anesthetic, anti-inflammatory & antibacterial / antifungal qualities. It can speed burn healing by stimulating growth of new skin. Non-steroidal anti-inflammatories and acetomenophen can be very helpful. Hydrate well and don't peel off any deep layers.