A general theory for the stability and coexistence of nonequilibrium phases is formulated. An integral formulation of the second entropy is given, the functional maximization of which yields nonlinear hydrodynamics. Rayleigh-Bénard convection is analyzed, and analytic approximations are obtained for the second entropy for conduction and for convection. Despite the simplicity of the model, coexistence is predicted for a Rayleigh number within 5% of the known value.