In a classical ideal gas with massive particles, the energy of the particles is distributed according to a Maxwell–Boltzmann distribution. This distribution is established as the particles collide with each other, exchanging energy (and momentum) in the process. In a photon gas, there will also be an equilibrium distribution, but photons do not collide with each other (except under very extreme conditions, see two-photon physics), so the equilibrium distribution must be established by other means. The most common way that an equilibrium distribution is established is by the interaction of the photons with matter. If the photons are absorbed and emitted by the walls of the system containing the photon gas, and the walls are at a particular temperature, then the equilibrium distribution for the photons will be a black-body distribution at that temperature.