Some 70 different molecular species have so far been detected variously in diffuse interstellar clouds, dense interstellar clouds and circumstellar shells. Only simple (diatomic and triatomic) species exist in diffuse clouds because of the penetration of destructive ultraviolet radiations, whereas more complex (polyatomic) molecules survive in dense clouds as a result of the shielding against this ultraviolet radiation provided by dust grains. A current list of interstellar molecules is given together with a few other molecular species that have so far been detected only in circumstellar shells. Also listed are those interstellar species that contain rare isotopes of several elements. The gas phase ion chemistry is outlined via which the observed molecules are synthesized, and the process by which enrichment of the rare isotopes occurs in some interstellar molecules is described. Reference is also made briefly to some very recent work in interstellar ion chemistry. A list of the atomic and molecular species that have been detected in cometary atmospheres is given and attention is drawn to the similarities and differences between interstellar and cometary molecules. The physical and chemical processes by which these observed cometary species may be generated from material that sublimes from the cometary nucleus are discussed.