Place some greenery in a sunny windowsill and within a day or two the plant will develop a decidedly hunched appearance as it bends in the direction of the glass. Turn the pot to encourage the stem to straighten, but the vertical position won't last long, as the movement continues to predictably pull the plant back toward the light. The means by which the plant is able to reposition itself in response to light stimuli results from a complex biochemical process.
The tendency of flora to bend in reaction to the position of a light source is called phototropism. This term derives from the Latin words photo for "light" and tropos for "to turn." Positive phototropism describes a bending toward light, such as many plant stems. Negative phototropism occurs, at least mildly, in plant roots, which bend away from light. Plants aren't the only organisms to exhibit phototropism; some species of fungi do too.
While it appears that phototropic plants are bending toward light, the movement is actually accomplished by increased growth along the dark side of the stem. The exposure of light to the growing tip of the plant is what drives the dark-side growth of the whole stem. In 1881 and 1882, Charles Darwin published papers detailing experiments he conducted on canary grass, where he found that only the still-growing tip of the grass exhibited a phototropic response. If he covered that tip, the stem of the plant did not bend toward light anymore.
Scientists didn't connect the mystery of phototropism to hormonal response in plants until the 1920s. Fritz W. Went isolated the hormone, which he dubbed "auxin" from the Greek word auxein, which means "to increase." This growth-enhancing hormone is manufactured in the tips of plants. In response to light stimuli, auxin travels in larger quantities to the dark side of the plant stem and stimulates differential growth there. The more auxin, the more growth.
Auxin works to enable plant growth by lowering pH concentrations where it is sent. As the acid increases around plant cells, enzymes break them down, allowing swelling around the weakened cell walls. This drives stem growth.
A stem that bends exposes more of the surface area of leaves to the plant's light source. Light is where plants derive their food, through a chemical process called photosynthesis. In photosynthesis, chlorophyll molecules located primarily in the leaves convert carbon dioxide and water into sugar, releasing oxygen as a by-product of the reaction. The better the leaf surface exposure, the more food for the plant. Phototropism is a very good mechanism for allowing the plant to best adapt to its available light source.