We review the gas-phase chemistry in extraterrestrial space that is driven by reactions with atomic and molecular ions. Ions are ubiquitous in space and are potentially responsible for the formation of increasingly complex interstellar molecules. Until recently, positively charged atoms and molecules were the only ions known in space; however, this situation has changed with the discovery of various molecular anions. This review covers not only the observation, distribution and reactions of ions in space, but also laboratory-based experimental and theoretical methods for studying these ions. Recent results from space-based instruments, such as those on the Cassini-Huygens space mission and the Herschel Space Observatory, are highlighted.