ANSWER - When potatoes are exposed to light, metabolic activity in the skin increases as it prepares to send out shoots. As a result, chlorophyll is formed, which provides the green color. Another product formed is solanine, which is a glycoalkaloid toxin. It has a bitter taste and can irritate the gastrointestinal tract. If enough is eaten it could cause symptoms such as vomiting and diarrhea. Because of the bitter taste, it is rare for someone to eat enough to actually get sick.
Small green spots can be trimmed off. If more extensive greening occurs, throw the potato out.
The tendency for potatoes to turn green and form solanine varies among varieties. To prevent it from happening, inspect potatoes at the store before purchasing and store them at home in a cool dark place with good air circulation.