Potatoes turn green when they are exposed to light, which causes the production of chlorophyll. This green coloration is often accompanied by the formation of solanine, a toxic compound that can cause gastrointestinal distress if consumed in large quantities. It's best to avoid eating green potatoes or to remove the affected areas before cooking.