Chemistry and physics of molecules and grains in space