The occasional green-gray discoloration on the surface of hard-cooked yolks is a harmless compound of iron and sulfur, ferrous sulfide. It forms at the interface of white and yolk because that’s where reactive sulfur from the former comes into contact with the iron from the latter. The alkaline conditions in the white favor the stripping of sulfur atoms from the albumen proteins when heat unfolds them, and the sulfur reacts with iron in the surface layer of yolk to form ferrous sulfide. The older the egg, the more alkaline the white, and the more rapidly this reaction occurs. High temperatures and prolonged cooking produce more ferrous sulfide.