When potatoes are not store properly (exposed to light) they can form chlorophyll. This isn't harmful but it is a sign that the toxin solanine is present. The green skin can be peeled and cut out to reduce levels of the toxin but if it's extensively green, it's best to throw the potato out. (Read more here)