What causes the Sun to make our skin brown?
Its a protection method by our body.
As the UV radiation reaches the lower levels of our skin, it tickles melanocytes, cells that basically act like photoreceptors
They detect the radiation and release Melanin, a pigment that browns our skin, making it harder for UV radiation to penetrate into the soft squishy stuff our skin is meant to protect.
Sun is mean and makes skin hurt if you play with sun too long. Play in shade or wear sunblock so the sun doesn’t hurt.
Which is the longest ultra violet rays 400nm – 320 nm just slightly more energetic than violet light.
This radiation will penetrate your skin and damage the DNA of skin cells and can cause damaged cells to turn into cancer cells. We have evolved a defense mechanism for this by producing melanin which sits around the cell nucleus and protects your DNA from the ionizing radiation.
Black or brown skin is an adaptation to living in regions with more intense sunlight, or rather white skin is a adaptation to living in colder climates because early humans all had dark skin, but it comes with a trade-off, like black skin absorbs around 30% more heat and also has a higher heat loss compared to white skin. It also makes it harder for the body to make vitamin D since UVA is needed by the body to create it, although ideally just getting vitamin D from supplements is better since supplements doesn’t cause cancer like sunbathing does. Another thing to remember is that you need to actually be in direct sunlight to get tanned because glass is not transparent to ultra violet so just standing behind a window or wearing glasses will block the UVA radiation, sunscreen will also almost completely block UVA radiation.
Your skin contains melanin which will naturally increase when exposed to the sun in order to prevent skin cancers. More sun exposure = more melanin = darker skin.