According to Scientific American, a sunburn causes skin redness, swelling and pain. These symptoms occur when the skin has a toxic reaction to the sun's ultraviolet rays. The UVA and UVB rays from the sun actually penetrate the skin and cause a change in the DNA of the skin.
The release of cutaneous blood cells and recruitment of the inflammatory cells cause the redness and swelling from a sunburn. A sunburn also contributes to premature aging of the skin, and according to WebMD, exposure to the sun (especially getting sunburned) is the primary contributor to malignant skin cancers such as melanoma.