Exposure of potato tubers to light either in the field, in storage, on the store shelf, or at home, will induce the formation of a green pigmentation on the surface of the potato. This is called "greening" and indicates the formation of chlorophyll. This pigment is completely safe and is found in all plants, lettuce, spinach etc.
But, in potato tubers, it is like the "canary in the mine shaft." The green indicates an increase in the presence of glycoalkaloids, especially, in potato, the substance "solanine". When the potato greens, solanine increases to potentially dangerous levels. Hence it is advised not to eat the green parts of the potato.
Commercial varieties of potatoes are screened for solanine levels, and most have a solanine content of less than 0.2mg/g. However potatoes that have been exposed to light and started to green can show concentrations of 1mg/g or more. In these situations a single unpeeled potato can result in a dangerous dose.
Increased solanine levels are responsible for the bitter taste in potatoes after being cooked.
Solanine biosynthesis occurs parallel but independent of chlorophyll biosynthesis; each can occur without the other. Unlike chlorophyll, light is not needed for solanine formation but is substantially promoted by it. The formation of solanine in potato is localized to the skin, usually no deeper than 3 mm. In processed potatoes such as chips and fries, there is little hazard since peels are removed.