A banded iron formation from the 3.15 Ga Moories Group, Barberton Greenstone Belt, South Africa. Red layers represent the times when oxygen was available, gray layers were formed in anoxic circumstances.

The first cells were likely heterotrophs, using surrounding organic molecules (including those from other cells) as raw material and an energy source.[31]:564-566 As the food supply diminished, a new strategy evolved in some cells. Instead of relying on the diminishing amounts of free-existing organic molecules, these cells adopted sunlight as an energy source. Estimates vary, but by about 3 Ga, something similar to modern oxygenic photosynthesis had probably developed, which made the sun’s energy available not only to autotrophs but also to the heterotrophs that consumed themThis type of photosynthesis, which became by far the most common, used the abundant carbon dioxide and water as raw materials and, with the energy of sunlight, produced energy-rich organic molecules (carbohydrates).
Moreover, oxygen was released as a waste product of the photosynthesis.[37] At first, it became bound up with limestone, iron, and other minerals. There is substantial proof of this in iron-oxide rich layers in geological strata that correspond with this period. The reaction of the minerals with oxygen would have turned the oceans green. When most of the exposed readily reacting minerals were oxidized, oxygen finally began to accumulate in the atmosphere. Though each cell only produced a minute amount of oxygen, the combined metabolism of many cells over a vast time transformed Earth’s atmosphere to its current state.[34]:50-51 Among the oldest examples of oxygen-producing lifeforms are fossil stromatolites. This was Earth’s third atmosphere.
Some of the oxygen was stimulated by incoming ultraviolet radiation to form ozone, which collected in a layer near the upper part of the atmosphere. The ozone layer absorbed, and still absorbs, a significant amount of the ultraviolet radiation that once had passed through the atmosphere. It allowed cells to colonize the surface of the ocean and eventually the land:[40] without the ozone layer, ultraviolet radiation bombarding land and sea would have caused unsustainable levels of mutation in exposed cells.
Photosynthesis had another, major, and world-changing impact. Oxygen was toxic; probably much life on Earth died out as its levels rose in what is known as the "oxygen catastrophe".[40] Resistant forms survived and thrived, and some developed the ability to use oxygen to increase their metabolism and obtain more energy from the same food.