What Happens When Your Skin Gets Sunburned?
Ultraviolet radiation begins damaging molecules inside skin cells before redness becomes visible. It can alter DNA directly and generate reactive molecules that damage additional cell structures.
Cells detect this damage and release chemical signals that produce inflammation. Blood vessels expand, bringing more blood to the affected area. The skin becomes red, warm, swollen, and painful, usually several hours after the exposure.
Severely damaged cells may destroy themselves to prevent abnormal growth. The immune system removes them, producing peeling several days later. A blister forms when greater injury separates layers of skin and fluid collects between them.
Melanin can absorb some ultraviolet radiation, so darker skin usually requires more exposure to develop visible burning. It can still experience DNA damage and sunburn.
The redness eventually disappears, but not every damaged cell is removed or perfectly repaired. Mutations can remain and accumulate after repeated exposure. This increases the risk of premature skin aging and several forms of skin cancer.
A tan is also a response to ultraviolet injury. Skin cells produce and distribute more melanin in an attempt to protect DNA from further exposure.
Source: The Risks of Tanning, United States Food and Drug Administration - Preventing Sunburn, Centers for Disease Control and Prevention

Perseids meteor shower, Luhasoo, Estonia
Source: Martin Mark