In physics, one thinks of a spectral line from two viewpoints.

An emission line is formed when an atom or molecule makes a transition from a particular discrete energy level *E*_{2} of an atom, to a lower energy level *E*_{1}, emitting a photon of a particular energy and wavelength. A spectrum of many such photons will show an emission spike at the wavelength associated with these photons.

An absorption line is formed when an atom or molecule makes a transition from a lower, *E*_{1}, to a higher discrete energy state, *E*_{2}, with a photon being absorbed in the process. These absorbed photons generally come from background continuum radiation (the full spectrum of electromagnetic radiation) and a spectrum will show a drop in the continuum radiation at the wavelength associated with the absorbed photons.

The two states must be bound states in which the electron is bound to the atom or molecule, so the transition is sometimes referred to as a "bound–bound" transition, as opposed to a transition in which the electron is ejected out of the atom completely ("bound–free" transition) into a continuum state, leaving an ionized atom, and generating continuum radiation.

A photon with an energy equal to the difference *E*_{2} - *E*_{1} between the energy levels is released or absorbed in the process. The frequency *ν* at which the spectral line occurs is related to the photon energy by Bohr's frequency condition *E*_{2} - *E*_{1} = *hν* where *h* denotes Planck's constant.

An atomic spectral line refers to emission and absorption events in a gas in which
n
2
is the density of atoms in the upper energy state for the line, and
n
1
is the density of atoms in the lower energy state for the line.

The emission of atomic line radiation at frequency *ν* may be described by an emission coefficient
ϵ
with units of energy/time/volume/solid angle. *ε dt dV dΩ* is then the energy emitted by a volume element
d
V
in time
d
t
into solid angle
d
Ω
. For atomic line radiation:

ϵ
=
h
ν
4
π
n
2
A
21
where
A
21
is the Einstein coefficient for spontaneous emission, which is fixed by the intrinsic properties of the relevant atom for the two relevant energy levels.

The absorption of atomic line radiation may be described by an absorption coefficient
κ
with units of 1/length. The expression *κ' dx* gives the fraction of intensity absorbed for a light beam at frequency *ν* while traveling distance *dx*. The absorption coefficient is given by:

κ
′
=
h
ν
4
π
(
n
1
B
12
−
n
2
B
21
)
where
B
12
and
B
21
are the Einstein coefficients for photo absorption and induced emission respectively. Like the coefficient
A
21
, these are also fixed by the intrinsic properties of the relevant atom for the two relevant energy levels. For thermodynamics and for the application of Kirchhoff's law, it is necessary that the total absorption be expressed as the algebraic sum of two components, described respectively by
B
12
and
B
21
, which may be regarded as positive and negative absorption, which are, respectively, the direct photon absorption, and what is commonly called stimulated or induced emission.

The above equations have ignored the influence of the spectroscopic line shape. To be accurate, the above equations need to be multiplied by the (normalized) spectral line shape, in which case the units will change to include a 1/Hz term.

For conditions of thermodynamic equilibrium, together the number densities
n
2
and
n
1
, the Einstein coefficients, and the spectral energy density provide sufficient information to determine the absorption and emission rates.

The number densities
n
2
and
n
1
are set by the physical state of the gas in which the spectral line occurs, including the local spectral radiance (or, in some presentations, the local spectral radiant energy density). When that state is either one of strict thermodynamic equilibrium, or one of so-called "local thermodynamic equilibrium", then the distribution of atomic states of excitation (which includes
n
2
and
n
1
) determines the rates of atomic emissions and absorptions to be such that Kirchhoff's law of equality of radiative absorptivity and emissivity holds. In strict thermodynamic equilibrium, the radiation field is said to be black-body radiation and is described by Planck's law. For local thermodynamic equilibrium, the radiation field does not have to be a black-body field, but the rate of interatomic collisions must vastly exceed the rates of absorption and emission of quanta of light, so that the interatomic collisions entirely dominate the distribution of states of atomic excitation. Circumstances occur in which local thermodynamic equilibrium does not prevail, because the strong radiative effects overwhelm the tendency to the Maxwell–Boltzmann distribution of molecular velocities. For example, in the atmosphere of the Sun, the great strength of the radiation dominates. In the upper atmosphere of the Earth, at altitudes over 100 km, the rarity of intermolecular collisions is decisive.

In the cases of thermodynamic equilibrium and of local thermodynamic equilibrium, the number densities of the atoms, both excited and unexcited, may be calculated from the Maxwell–Boltzmann distribution, but for other cases, (e.g. lasers) the calculation is more complicated.

In 1916, Albert Einstein proposed that there are three processes occurring in the formation of an atomic spectral line. The three processes are referred to as spontaneous emission, stimulated emission, and absorption. With each is associated an Einstein coefficient, which is a measure of the probability of that particular process occurring. Einstein considered the case of isotropic radiation of frequency *ν* and spectral energy density *ρ*(*ν*).

Hilborn has compared various formulations for derivations for the Einstein coefficients, by various authors. For example, Herzberg works with irradiance and wavenumber. Yariv works with energy per unit volume per unit frequency interval; also; this is how the present account is formulated. Mihalas & Weibel-Mihalas work with radiance and frequency; also Chandrasekhar; also Goody & Yung; Loudon uses angular frequency and radiance.

Spontaneous emission is the process by which an electron "spontaneously" (i.e. without any outside influence) decays from a higher energy level to a lower one. The process is described by the Einstein coefficient *A*_{21} (*s*^{−1}), which gives the probability per unit time that an electron in state 2 with energy
E
2
will decay spontaneously to state 1 with energy
E
1
, emitting a photon with an energy *E*_{2} − *E*_{1} = *hν*. Due to the energy-time uncertainty principle, the transition actually produces photons within a narrow range of frequencies called the spectral linewidth. If
n
i
is the number density of atoms in state *i* , then the change in the number density of atoms in state 2 per unit time due to spontaneous emission will be

(
d
n
2
d
t
)
spontaneous
=
−
A
21
n
2
.
The same process results in increasing of the population of the state 1:

(
d
n
1
d
t
)
spontaneous
=
A
21
n
2
.
Stimulated emission (also known as induced emission) is the process by which an electron is induced to jump from a higher energy level to a lower one by the presence of electromagnetic radiation at (or near) the frequency of the transition. From the thermodynamic viewpoint, this process must be regarded as negative absorption. The process is described by the Einstein coefficient
B
21
(J^{−1} m^{3} s^{−2}), which gives the probability per unit time per unit spectral energy density of the radiation field that an electron in state 2 with energy
E
2
will decay to state 1 with energy
E
1
, emitting a photon with an energy *E*_{2} − *E*_{1} = *hν*. The change in the number density of atoms in state 1 per unit time due to induced emission will be

(
d
n
1
d
t
)
neg. absorb.
=
B
21
n
2
ρ
(
ν
)
,
where
ρ
(
ν
)
denotes the spectral energy density of the isotropic radiation field at the frequency of the transition (see Planck's law).

Stimulated emission is one of the fundamental processes that led to the development of the laser. Laser radiation is, however, very far from the present case of isotropic radiation.

Absorption is the process by which a photon is absorbed by the atom, causing an electron to jump from a lower energy level to a higher one. The process is described by the Einstein coefficient
B
12
(J^{−1} m^{3} s^{−2}), which gives the probability per unit time per unit spectral energy density of the radiation field that an electron in state 1 with energy
E
1
will absorb a photon with an energy *E*_{2} − *E*_{1} = *hν* and jump to state 2 with energy
E
2
. The change in the number density of atoms in state 1 per unit time due to absorption will be

(
d
n
1
d
t
)
pos. absorb.
=
−
B
12
n
1
ρ
(
ν
)
.
The Einstein coefficients are fixed probabilities per time associated with each atom, and do not depend on the state of the gas of which the atoms are a part. Therefore, any relationship that we can derive between the coefficients at, say, thermodynamic equilibrium will be valid universally.

At thermodynamic equilibrium, we will have a simple balancing, in which the net change in the number of any excited atoms is zero, being balanced by loss and gain due to all processes. With respect to bound-bound transitions, we will have detailed balancing as well, which states that the net exchange between any two levels will be balanced. This is because the probabilities of transition cannot be affected by the presence or absence of other excited atoms. Detailed balance (valid only at equilibrium) requires that the change in time of the number of atoms in level 1 due to the above three processes be zero:

0
=
A
21
n
2
+
B
21
n
2
ρ
(
ν
)
−
B
12
n
1
ρ
(
ν
)
Along with detailed balancing, at temperature *T* we may use our knowledge of the equilibrium energy distribution of the atoms, as stated in the Maxwell–Boltzmann distribution, and the equilibrium distribution of the photons, as stated in Planck's law of black body radiation to derive universal relationships between the Einstein coefficients.

From the Maxwell–Boltzmann distribution we have for the number of excited atomic species *i*:

n
i
n
=
g
i
e
−
E
i
/
k
T
Z
where *n* is the total number density of the atomic species, excited and unexcited, *k* is Boltzmann's constant, *T* is the temperature,
g
i
is the degeneracy (also called the multiplicity) of state *i*, and *Z* is the partition function. From Planck's law of black-body radiation at temperature *T* we have for the spectral energy density at frequency *ν*

ρ
ν
(
ν
,
T
)
=
F
(
ν
)
1
e
h
ν
/
k
T
−
1
where:

F
(
ν
)
=
8
π
h
ν
3
c
3
where
c
is the speed of light and
h
is Planck's constant.

Substituting these expressions into the equation of detailed balancing and remembering that *E*_{2} − *E*_{1} = *hν* yields:

A
21
g
2
e
−
h
ν
/
k
T
+
B
21
g
2
e
−
h
ν
/
k
T
F
(
ν
)
e
h
ν
/
k
T
−
1
=
B
12
g
1
F
(
ν
)
e
h
ν
/
k
T
−
1
separating to:

A
21
g
2
(
e
h
ν
/
k
T
−
1
)
+
B
21
g
2
F
(
ν
)
=
B
12
g
1
e
h
ν
/
k
T
F
(
ν
)
The above equation must hold at any temperature, so

B
21
g
2
=
B
12
g
1
,
and

−
A
21
g
2
+
B
21
g
2
F
(
ν
)
=
0
Therefore, the three Einstein coefficients are interrelated by:

A
21
B
21
=
F
(
ν
)
and

B
21
B
12
=
g
1
g
2
When this relation is inserted into the original equation, one can also find a relation between
A
21
and
B
12
, involving Planck's law.

The oscillator strength
f
12
is defined by the following relation to the cross section
σ
for absorption:

σ
=
e
2
4
ε
0
m
e
c
f
12
ϕ
ν
=
π
e
2
2
ε
0
m
e
c
f
12
ϕ
ω
where
e
is the electron charge,
m
e
is the electron mass, and
ϕ
ν
and
ϕ
ω
are normalized distribution functions in frequency and angular frequency respectively. This allows all three Einstein coefficients to be expressed in terms of the single oscillator strength associated with the particular atomic spectral line:

B
12
=
e
2
4
ε
0
m
e
h
ν
f
12
B
21
=
e
2
4
ε
0
m
e
h
ν
g
1
g
2
f
12
A
21
=
2
π
ν
2
e
2
ε
0
m
e
c
3
g
1
g
2
f
12