When you tan at an indoor tanning facility, your skin produces a tan the same way it does when you lay out in the sun: through ultraviolet (UV) rays. There is one important difference, however.
When you are out in the sun, you cannot control the amount of UV rays you are exposed to, because it is affected by changes in the atmosphere.
Indoor tanning is one way to regulate the amount of UV light you are exposed to, because it is a controlled environment. You can gradually increase your exposure time to make sure you don't get sunburned, which is harmful to the skin.
Tanning beds and booths basically imitate the sun. The sun emits three kinds of UV rays (the ones that make you tan). UV-C has the shortest wavelength of the three, and is also the most harmful. The sun emits UV-C rays, but then it's absorbed by the ozone layer and pollution.
Tanning lamps filter out this type of UV rays. UV-B, the middle wavelength, starts the tanning process, but overexposure can cause sunburn.
UV-A has the longest wavelength, and it completes the tanning process. Tanning lamps use the best ration of UVB and UVA rays to provide optimal tanning results, with a lowered risk of overexposure.