I keep all the water samples I collect for some time sitting on the windowsill in the sun. Over time, the composition of organisms in each sample changes dramatically. Some species die off while others proliferate. These images show a population of colonial cyanobacteria (family Nostocaceae) that proliferated in one of my samples. They grow in filaments that are one cell thick. Each filament is a colony of genetically identical cells.

What you can see here are many colonies, bunched up together. Some of the cells in each colony have differentiated from the others  (they're slightly larger and elongated). These cells are specialists; they are called heterocysts and they're able to fix nitrogen from the atmosphere. They fix this nitrogen and share it among every cell in the colony (all the cells need nitrogen to survive). Once a cell has become a heterocyst it can no longer reproduce so these heterocysts have sacrificed their own reproductive potential for the good of the colony. Cooperative behaviors such as this evolved early on are very important in the evolution of all life.

Some species of cyanobacteria form symbiotic relationships with other organisms too. It's common to find them growing among plants such as mosses, liverworts and hornworts. Those plants can also make use of the nitrogen produced by the cyanobactrial heterocysts. 

All cyanobacteria are capable of photosynthesis. In order to photosynthesize a cell needs to have chlorophyll pigments. It's these pigments that allow the energy from sunlight to be harvested. Chlorophyll pigments are responsible for the green color of most photosynthetic organisms.