  We present a self-consistent model of accretion flows which unifies four
distinct spectral states observed in black hole X-ray binaries: quiescent, low,
intermediate and high states. In the quiescent, low and intermediate states,
the flow consists of an inner hot advection-dominated part extending from the
black hole horizon to a transition radius and an outer thin disk. In the high
state the thin disk is present at all radii. The model is essentially
parameter-free and treats consistently the dynamics of the accretion flow, the
thermal balance of the ions and electrons, and the radiation processes in the
accreting gas. With increasing mass accretion rate, the model goes through a
sequence of stages for which the computed spectra resemble very well
observations of the four spectral states; in particular, the low-to-high state
transition observed in black hole binaries is naturally explained as resulting
from a decrease in the transition radius. We also make a tentative proposal for
the very high state, but this aspect of the model is less secure.
  We test the model against observations of the soft X-ray transient Nova
Muscae during its 1991 outburst. The model reproduces the observed lightcurves
and spectra surprisingly well, and makes a number of predictions which can be
tested with future observations.
