Plants, unlike animals, do not get food by eating other organisms (as always in nature, there are exceptions: carnivorous plants such the Venus fly trap). They make their own food, usually in the form of glucose, from the inorganic compounds carbon dioxide and water. Carbon dioxide is taken in through the leaves, and water is taken in mainly through the roots. Sunlight acts as the energy needed to run the reaction that yields glucose as the product the plant needs and oxygen as a waste product that is released into the environment.
In green plants and algae, the pigment molecules that initially absorb the light energy are chlorophyll, with accessory pigments such as carotenoids, phycobilin, or phycoerythrin. Some halobacteria use other primary photosynthetic pigments than chlorophyll, notably bacteriorhodopsin. It may be noted that the typical colors of photosynthetic organisms (green, brown, golden, or red) result from the light that is not absorbed by the pigment molecules, but instead is reflected before meeting the eye.
The typical overall chemical reaction of photosynthesis is:
6H2O + 6CO2 + light → C6H12O6 (glucose) + 6O2
In simple English, this is carbon dioxide plus water plus light (energy) yields oxygen plus sugar. In animals, this is exactly reversed in the process of respiration (which plants also use, to release the energy stored in photosynthesis): oxygen plus sugar yields carbon dioxide plus water plus energy. However, it is important to note that this chemical equation is highly simplified; in reality photosynthesis employs a very complex mechanism for the adsorption and conversion of light into chemical energy, using chemical pathways with many important intermediates. Photosynthesis has two distinct stages, called the light reaction and carbon fixation (often called the dark reaction as it is not dependent on light, but the term is confusing as it has nothing to with the dark), which typically occurs via the Calvin cycle.
Primary production is the amount of carbon fixed by plants per unit area over time via photosynthesis.
The production of oxygen
It is interesting to note that the oxygen released during photosynthesis is not in fact derived from the carbon dioxide, but rather from the water molecules which are consumed in the reaction. This was first proposed in the 1930s by C. B. van Neil of Stanford University, while investigating photosynthetic bacteria, many of which do not release oxygen. One significant group of such organism are bacteria which use hydrogen sulfide instead of water in their photosynthetic pathway:
12H2S + 6CO2 + light → C6H12O6 + 6H2O + 12S
Some of these produce globules of sulfur as a waste product instead of oxygen, while others further oxidize it, producing sulfates. In general, photosynthesis requires a source of hydrogen with which to reduce carbon dioxide into carbohydrates. Van Neil's proposal was confirmed 20 years later by using the O18 isotope of oxygen as a tracer label to follow the fate of oxygen atoms during photosynthesis.
Oxygen is not only a waste product of photosynthesis, it can even harm the photosynthetic process. This is because RubisCO, the primary CO2-fixing enzyme in most plants, also "fixes" oxygen, but this does not lead to useful sugar production. Rather, it results in the loss of both CO2 and nitrogen (in the form of ammonia, NH3) from the plant, in a process known as photorespiration. While some evidence indicates that photorespiration can help protect plants from damage due to very high light intensities, it is generally considered a wasteful process, in which as much as 50% of the plant's fixed carbon can be lost to the atmosphere. Some plants have evolved strategies to minimize photorespiration; these plants are grouped into C4 plants and CAM plants.
The "light reactions" are the first processes of photosynthesis. In them, light is absorbed by molecules of the green pigment chlorophyll. The light is used to "charge" an electron, which is transported via an electron transport system to a molecule of NADP+, which turns into the hydrogen carrier NADPH (used later on in the Calvin cycle).
In the meantime, a molecule of water is split. The oxygen is released into the atmosphere, while the hydrogen ions (which are merely protons after being split from oxygen) diffuse through Transmembrane ATPase. This energy is harnessed to synthesize a molecule of ATP.
The Calvin cycle
The Calvin cycle is similar to the Krebs cycle in some regards. Carbon enters the Calvin cycle in the form of CO2 and leaves in the form of a carbohydrate such as sugar, with the reaction being driven by ATP and NADPH. This ATP and NADPH is usually produced by the light reaction described above, but there is nothing inherent in the process which requires this to be the case; other sources of ATP and NADPH can be used, and in some cases are.