Abstract Sublimation of gases from ices in porous bodies is an important, observable phenomenon in the solar system. Dust mantle build-up and surface erosion on a comet nucleus and coma formation are processes related to the flux of sublimating gases. Computer simulations are performed to model the gas flux from volatile, icy components in the surface layer of a porous, Jupiter-family model comet assuming a porous body, containing dust and up to four components of chemically different ices (e.g. H 2O, CO, CO 2, CH 4). The mass and energy equations are solved for the different volatiles simultaneously. Inflowing and outflowing gas within the body, dust mantle build-up, depletion of the most volatile ices in outer layers, and recondensation of gases in deeper layers are included in the model. The calculations start with a homogeneously mixed body at a constant temperature and a constant mass density at aphelion of an orbit. The internal heat of the body increases due to insolation and conduction. As a result of sublimation of the minor, more volatile components, the initially homogeneous body differentiates into a layered body. The depths of the boundaries between the layers (sublimation fromts of the corresponding volatile phases) change with time and are on the order of tens of meters. Temperature, porosity, relative chemical abundance, and pore size distributions are obtained as a function of depth, and the gas flux into the interior and into the coma for each of the volatiles at various positions of the comet in its orbit. The ratio of the gas flux of minor volatiles to that of H 2O in the coma varies by several orders of magnitude throughout the orbit and cannot be simply related to the mixing ratio of the ices in the body. It is believed that the mixing ratio of the minor constituents of frozen gases in the ice-dust conglomerate of the nucleus is a very important clue to the original composition of the frozen gases in the solar nebula, but it is not well understood. To address this important issue, the present coma chemistry model is combined with the nucleus surface layers model for a more physically realistic gas production rate from which to begin the coma calculations. The combined model incorporates gas production into the coma from three sources: volatile sublimation at the nucleus surface, subsurface sublimation of volatiles from the interior, and release of gas from the dust grains in the coma (distributed sources).