The greening you're experiencing occurs when potatoes have been exposed to too much light, either natural or artificial (grocery store lighting), that gives the potatoes a sort of "sunburn." While greening is a result of light exposure, the visible greening can be delayed. Potatoes exposed to light may be packaged and continue to green beyond our last inspection point. We make every effort to avoid this, however, sometimes it's unavoidable.
You can cut the green out of the potatoes and use the rest, but eating the green portion of the potato can give a very bitter flavor. Here's some additional information if you'd like to see more: www.potatogoodness.com/potato-greeningfact-check.