The study of the chemical processes occurring in space, including the formation of complex molecules necessary for life.