The biochemical process by which green plants and some bacteria capture light energy and use it to produce chemical bonds. Carbon dioxide and water are consumed while oxygen and simple sugars are produced.