Plants respond to gravity by consistently causing their roots to grown downward and their stems to grow upward by sensing the direction of gravity with the use of tiny starch granules within specialized cells. This growth in response to gravity is known as gravitropism.
The tendency of shoots to grow upward against the force of gravity is known as negative gravitropism and is meant to help the plant access sunlight. The starch grains the specialized cells use to detect the direction of gravity release calcium ions from certain cell structures on contact. This in turn causes the cells to release a special plant hormone that causes the lower layers of cells to grow more than the upper layers. This makes the stems consistently grow upward. The specialized cells that perform this function are known as statoliths, which are a special type of unpigmented cell known as an amyloplast.
In roots, the opposite effect happens, with cell growth inhibited on the lower sides and allowed to progress normally on the upper sides. This effect in roots is known as positive gravitropism. These effects are only active until the point when the root or stem begins to grow vertically, at which point the starch granules reach a neutral position and stop releasing hormones.