What are comet tails made of and where do they come from?

Comets are usually made of high amounts of Hydrogen, Nitrogen, Water, and also may contain Silica, traces of metal, and oxygen, like a giant dirty snow ball. In space as the cosmic radiation smashes into the comet at near speeds of light and heats the outer layer, bits and pieces fall off and trail behind the comet. For a relatively short while, the chunks fortunate to stay in fairly good sizes or obscured from the light by other chunks or dust, are able to maintain these materials. After gases sublimate and and break down into neutrinos and electrons and such things. The remains are the tougher elements such as silica and metal, However after a while these eventually break up also.