All atoms and molecules emit distinctive spectral lines across the spectrum, the details of which depend on the internal structures of the species (for example, the vibration and rotation properties of molecules) and how they are excited by their environments. Measurements of the features' brightnesses, relative intensities, and shapes enable astronomers, at least in principle, to reconstruct most of the essential properties of these environments, including species abundances, temperatures, densities, and motions. But in order to be successful, scientists need to know quantitatively exactly how the temperature, density, and so forth, affect the excitation of each atom or molecule, and then how each species emits light in response. A collision between oxygen and nitrogen molecules, for example, will affect an oxygen molecule differently than its collision with hydrogen.
source https://www.lifetechnology.com/blogs/life-technology-news-blog/modeling-exoplanet-atmospheres