The UV rays that cause a sunburn don't just affect the top layer of your skin. They may sink into your skin cells and alter the DNA of the cell. This can lead to skin cancers like basal cell carcinoma, squamous cell carcinoma, and melanoma years after the sunburn took place. In fact, a really bad sunburn early in life can mean that you have twice the risk of getting melanoma later. And just five sunburns in a lifetime, regardless of severity, also puts you at twice the risk.