Rain pains in the head occur due to changes in barometric pressure, which happens before the rain. Because of the pressure difference, person's blood vessels try to adapt, narrowing and expanding.
If the blood vessels have difficult adaptation, there is less oxygen going to the head (brain), which causes headaches when it rains.