Purple and green bacteria and cyanobacteria are photosynthetic. Photosynthetic bacteria are able to produce energy from the sun's rays in a process similar to that used by plants. Instead of using chlorophyll to capture the sun's light, these bacteria use a compound called bacteriochlorophyll.
Cyanobacteria are unicellular organisms that live in water. Fossilized cyanobacteria have been on Earth a long time and play an important role in the food chain. They likely generated much of the oxygen in the atmosphere and are the precursors to chloroplasts, which allow plants to make their own food. They convert nitrogen in the soil into a form that can be used by some plants.
There are two varieties of purple bacteria. One variety uses sulfur instead of oxygen to carry out the process of photosynthesis, and oxygen can actually inhibit their growth. These bacteria live in aquatic environments with oxygen deficiencies. The other variety of purple bacteria resides in oxygenated environments and requires oxygen for photosynthesis.
Like purple bacteria, some green bacteria conduct photosynthesis by using sulfur. Though often located in estuaries, green bacteria have also been discovered in the deep ocean near hydrothermal vents. Though very little light penetrates to these depths, the tiny amount of light that does is used by the green bacteria to create energy.