Rain pains in the head occurs due to changes in barometric pressure, which happens before the rain. Due to the pressure difference, a person's blood vessels try to adapt and narrow and expand.
If there are difficulties with the adaptation of blood vessels, less oxygen can enter the head (brain), which causes a headache during rain.