A theory of the interaction of a cumulus cloud ensemble with the large-scale environment is developed. In this theory, the large-scale environment is divided into the subcloud mixed layer and the region above. The time changes of the environment are governed by the heat and moisture budget equations for the subcloud mixed layer and for the region above, and by a prognostic equation for the depth of the mixed layer. In the environment above the mixed layer, the cumulus convection affects the temperature and moisture fields through cumulus-induced subsidence and detrainment of saturated air containing liquid water which evaporates in the environment. In the subcloud mixed layer, the cumulus convection does not act directly on the temperature and moisture fields, but it affects the depth of the mixed layer through cumulus-induced subsidence. Under these conditions the problem of parameterization of cumulus convection reduces to the determination of the vertical distributions of the total vertical mass flux by the ensemble, the total detrainment of mass from the ensemble, and the thermodynamical properties of the detraining air. The cumulus ensemble is spectrally divided into sub-ensembles according to the fractional entrainment rate, given by the ratio of the entrainment per unit height to the vertical mass flux in the cloud. For these sub-ensembles, the budget equations for mass, moist static energy, and total water content are obtained. The solutions of these equations give the temperature excess, the water vapor excess, and the liquid water content of each sub-ensemble, and further reduce the problem of parameterization to the determination of the mass flux distribution function, which is the sub-ensemble vertical mass flux at the top of the mixed layer. The cloud work function, which is an integral measure of the buoyancy force in the clouds, is defined for each sub-ensemble; and, under the assumption that it is in quasi-equilibrium, an integral equation for the mass flux distribution function is derived. This equation describes how a cumulus ensemble is forced by large-scale advection, radiation, and surface turbulent fluxes, and it provides a closed parameterization of cumulus convection for use in prognostic models of large-scale atmospheric motion.