The skin’s epidermis, or top layer, contains melanocytes, which are cells that produce melanin when stimulated with ultraviolet light. When you sit under an tanning bed or in a tanning booth, the lamps stimulate the melanocytes to produce melanin, which appears as a dark pigment on the epidermis. The melanin is produced by your body as a way to protect you from further sun exposure. The longer the exposure to the tanning equipment’s UV rays, the more melanin that is stimulated.