As you probably know, human skin consists of two main layers. The upper layer is called the epidermis, while the lower layer is known as the dermis.
The bottom layer of the epidermis, known as the stratum basale, contains specialised, distorted cells called melanocytes. These melanocytes produce a dark brown or black polymer pigment derived from tyrosine called melanin which is responsible for the overall "darkness" of the skin. The purpose of melanin is to try to prevent harmful UV radiation from reaching the more sensitive dermis. The stratum basale is constantly renewed and the melanocytes and melanin move upwards towards the outermost layer of the epidermis resulting in a fairly even level of pigmentation.
Melanin production is governed by the amount of sunlight that falls on a given skin area. In other words, the more exposed the skin, the darker it becomes in order to protect the skin from UV radiation.
The epidermis has four other layers that sit above the stratum basale before the surface of the skin is reached, so a fair amount of exposure to sunlight or UV radiation is needed before skin browns or even tans.
Contrary to popular belief, different races do not differ in the number of melanocytes in the skin. The only thing that does change is the rate of production and quantity of melanin produced from these cells due to exposure to UV radiation.
The palms of the hands, soles of the feet and a few other areas of the body are normally less exposed to UV radiation than other areas of the body. Therefore, melanin is not needed and the skin in these areas is generally lighter in colour. In addition, these areas contain another thick epidermal layer called the stratum lucidum which gives additional protection.