First, you need to know how your skin gets its normal color. The top layer of your skin, called the epidermis, contains cells called melanocytes, which produce the pigment melanin when you’re exposed to the sun. Melanin has many functions, one of which is to help block ultraviolet rays. When you tan and your skin turns brown, that’s the melanin working to protect the layers of your skin.
Skin discoloration can have many causes, ranging from cosmetic issues to more complex skin issues. Sun exposure can cause tanning and burning, and can make existing skin conditions flare up while damaging your skin. Some medications have side effects that cause skin discoloration. They might even make you more sensitive to the sun, which can also lead to discoloration. Also, don’t forget about age. Exposure to the sun over time causes age spots (also known as liver spots), which start showing up as you get older.