The heart of a comet is a solid body, with a diameter in the order of tens of kilometers, which is called the nucleus.
This nucleus is very cold, since the comet's orbit usually is such that it spends much time far from the Sun. Its material therefore is frozen. The currently held view is that of the "dirty snowball": the nucleus is an irregularly shaped loosely packed mixture of
- ice (carbon dioxide and monoxide ices, frozen ammonia, and a little bit of water ice)
- rock boulder sand dust grains (silicates)
Heating up near the Sun
When this frozen nucleus journeys into the inner regions of the Solar System, it heats up because of the increasing solar radiation. The ices on its surface begin to evaporate. This seems to happen typically at a few isolated spots on the surface.
This can be seen in the close-up views of cometary nucleus obtained, by the European Space Agency's Giotto (1986) and Rosetta (2015) probes: the pictures show bright jets of gas emanating from the differently shaped nucleus.
Since the nucleus typically rotates, the jets give rise to periodic brightness variations in the tail, which have been used in the past to estimate the nucleus' rotation period. The release of gas is accompanied by the escape of dust grains that were mixed with the evaporating ice.