Sunlight carries invisible UV rays. When they hit the skin, it makes a brown pigment — melanin — that settles like tiny parasols over the cells. That is why skin turns brown: it is the skin defending itself.