In order to understand what are comets made of, we need to break down the three main parts of the comet: the nucleus, coma, and tail. Comet nuclei are known to range from about 100 meters to more than 40 kilometers across. They are composed of rock, dust, ice and frozen gases such as carbon monoxide, carbon dioxide, methane, and ammonia. Sometimes called dirty snowballs, recent studies have shown that the ice of a comet is covered by a crust. Comets also contain a variety of organic compounds as well as the gases already mentioned. Some of these are methanol, hydrogen cyanide, formaldehyde, ethanol, and ethane. More complex molecules such as long-chain hydrocarbons and amino acids may also be in comets. Because of their low mass, comets cannot become spherical under their own gravity, and will thus have irregular shapes.
The coma is the the nebulous envelope around the nucleus of a comet. It is formed when the comet passes close to the Sun on a highly elliptical orbit. As the comet warms, parts of it turn from solid to gas(sublimate). Larger charged dust particles are left along the comet’s orbital path while smaller charged particles are pushed away from the Sun into the comet’s tail by solar wind. This helps astronomers distinguish comets from stars because it creates a fuzzy appearance.
The tail is illuminated by the Sun and may become visible from Earth when a comet passes through the inner solar system, the dust reflecting sunlight directly and the gases glowing from ionization. The streams of dust and gas each form their own distinct tail, pointing in slightly different directions. The tail of dust is left behind in the comet’s orbit in such a manner that it often forms a curved tail called the antitail. At the same time, the ion tail, made of gases, always points directly away from the Sun, as this gas is more strongly affected by the solar wind than is dust, following magnetic field lines rather than an orbital trajectory. Paralax viewing from the Earth may sometimes mean the tails appear to point in opposite direction.
Understanding the three parts of the comet is essential to know what are comets made of. Here is an article with a little more detail. Here on Universe Today there is a great article on a comet/asteroid hybrid. Astronomy Cast has another outstanding episode about solar dust.