Chemosynthesis in Bacteria
These chemo-synthetic bacteria gets energy from oxidation of inorganic compounds. Following table from Biology of Prokaryotes shows main reactions used by different species, 



This oxidation happens only if electron acceptor is available. These all reactions have negative Gibbs Free Energy, hence they are favorable reactions and happens spontaneously. Generally oxygen is preferred electron acceptor but in case of lack of oxygen nitrate, sulfate, $HCO^{3-}$ etc are used.