Jeffrey M. Sobell, an assistant professor of dermatology and director of photomedicine at Tufts University School of Medicine, offers the following explanation:
Sunburns differ significantly from thermal burns, which result from infrared radiation. Although infrared radiation gives sunlight its warmth, it is not the heat of the sun that burns skin. A sunburnmanifested by cutaneous redness, swelling and painis an acute toxic reaction caused by exposure to the sun's ultraviolet radiation. Although the precise mechanism by which a sunburn occurs has not been clearly identified, complex chemical reactions and pathways take place that most likely result in the clinical symptoms.
The energy from ultraviolet radiation can damage molecules in the skin, most importantly DNA. One consequence of this is the synthesis of different proteins and enzymes. The effects of these proteins, notably prostaglandins and cytokines, lead to dilation of the cutaneous blood vessels and recruitment of inflammatory cells. This, in turn, produces a sunburn's characteristic redness, swelling and pain. Once the signal of excessive radiation exposure is initiated, it generally takes four to six hours for these proteins to generate. Sunburn symptoms thus don't appear until well after exposure. (DNA damage can also result in the destruction of the involved skin cell. This is one of the reasons why skin peels after a bad sunburn.)
The body does have mechanisms to repair damaged DNA after ultraviolet exposure. But as the frequency of sunlight exposure increases, so, too, does the probability that some of that damage will escape repair. This mutated DNA may eventually lead to skin cancer.
The warmth of a sunburn generally stems from increased blood flow to the exposed site. I am unaware of any temperature measurements of sunburned skin, but I suspect that even though the burned skin seems much warmer, it would still be close to 98.6 degrees. Any slight elevation in temperature would be a result of the inflammatory response generated from the chemical processes induced by ultraviolet radiation.