To understand the transition from sunburn to tan, it’s essential to first comprehend what exactly happens to your skin during sun exposure. When your skin is exposed to UV rays, it triggers a response from melanocytes, the cells responsible for producing melanin—the pigment that gives skin its color. Melanin acts as a natural defense mechanism, absorbing and dispersing UV rays to prevent further damage.