Plants capture energy from the sun through a process called photosynthesis; this process supports nearly all life on earth. But photosynthesis is not the only method that living organisms use to create energy. Some microorganisms derive energy from chemical reactions that don't require light and use this energy to assemble organic molecules through a process called chemosynthesis. These organisms are called chemolithoautotrophs or simply chemoautotrophs.
Basically, chemoautotrophs derive energy from chemical reactions that don't need light (unlike photosynthesis). This ability enables chemoautotrophs to live in some unusual environments. The most famous chemoautotrophs are the extremophiles (organisms that live in extreme conditions) found near deep-sea vents at the bottom of the ocean floor. No light penetrates to those depths; bacteria that live there are sunk in an eternal night in which no photosynthetic organism can survive. The process these bacteria and other chemoautotrophs use to get the energy they need is complex, but the basic steps are outlined below.
Redox (oxidation-reduction) reactions involve the transfer of electrons; often these reactions can release a considerable amount of energy. Fire (combustion) is a redox reaction, for example. Chemoautotrophs use enzymes (proteins that can catalyze or speed up reactions) to catalyze a redox reaction, taking electrons from an electron donor like hydrogen sulfide or iron and donating it to a carrier molecule.
The carrier molecule passes the electrons it's received to a series of proteins called the electron transport chain. These proteins now pass the electrons along down the chain like batons in a relay race. As each protein first gains then loses an electron, it uses this energy to pump a hydrogen ion (a proton) out of the cell--like using an electric current to pump water up a hill and store energy.
The electron transport chain increases the concentration of hydrogen ions outside the cell so that the hydrogen ions want to flow back in, just as the water pumped to the top of a hill wants to flow back down. The bacterium has a protein called ATP synthase embedded in its membrane; just as you could use water stored atop a hill to drive a turbine, the cell's ATP synthase uses the flow of hydrogen ions to power a chemical process that makes a molecule called ATP. ATP is to a cell what sugar is to your body: it's a form of stored energy the cell can readily break down any time it needs it. Essentially, the cell has taken the energy from a redox reaction and through a series of steps stored it as ATP.
Once it's produced ATP, the bacterium can use the energy it's stored in ATP to turn inorganic compounds like CO2 and hydrogen sulfide into organic compounds like glucose. This final series of reactions is called chemosynthesis.