  Solitons and breathers are localized solutions of integrable systems that can
be viewed as "particles'' of complex statistical objects called soliton and
breather gases. In view of the growing evidence of their ubiquity in fluids and
nonlinear optical media these "integrable'' gases present fundamental interest
for nonlinear physics. We develop analytical theory of breather and soliton
gases by considering a special, thermodynamic type limit of the
wavenumber-frequency relations for multi-phase (finite-gap) solutions of the
focusing nonlinear Schr\"odinger equation. This limit is defined by the locus
and the critical scaling of the band spectrum of the associated Zakharov-Shabat
operator and yields the nonlinear dispersion relations for a spatially
homogeneous breather or soliton gas, depending on the presence or absence of
the "background'' Stokes mode. The key quantity of interest is the density of
states defining, in principle, all spectral and statistical properties of a
soliton (breather) gas. The balance of terms in the nonlinear dispersion
relations determines the nature of the gas: from an ideal gas of well
separated, non-interacting breathers (solitons) to a special limiting state,
which we term breather (soliton) condensate, and whose properties are entirely
determined by the pairwise interactions between breathes (solitons). For a
non-homogeneous breather gas, we derive a full set of kinetic equations
describing slow evolution of the density of states and of its carrier wave
counterpart. The kinetic equation for soliton gas is recovered by collapsing
the Stokes spectral band. A number of concrete examples of breather and soliton
gases are considered, demonstrating efficacy of the developed general theory
with broad implications for nonlinear optics, superfluids and oceanography.
