Comets have tails (two of them, in fact) because of stuff coming off the comet's core. One of the tails is made of dust. The other tail is made of gasses.
Both of these tails point more or less away from the sun. The reason for this has to do with what we typically call the solar wind. There is all kinds of radiation coming off the sun and heading off into space in all directions. This radiation "blows" all the dust and gas that make up the tails. Because of this, the tail points away from the sun just as a flag blows away from the source of the wind here on Earth.
A comet is a large lump of frozen gas mixed with bits of dust.It orbits around the sun.When it is far from the sun,it is frozen and solid.When it gets close to the sun,the sun's heat boils of some of the frozen material.This material then forms an atmosphere around the comet.The remaining material(nucleus)and the atmosphere(coma) form the head.The stream of light particles coming from the sun(solar wind),blows the gas and dust particles in the coma into one or two long curved tails.A comet's tail always curves away from the sun.The tail glows because sunlight shines on the gas and dust and also releases energy from the gas.
Comets are natural icy bodies that travel round the sun in long oval orbits. Comets consist of solid center called nucleus, which is composed of mostly ice resembling a dirty snowball. The nucleus contains ice in different forms and some dust particles. The nucleus is surrounded by a cloudy atmosphere called coma and one or two tails. When a comet comes nearer to the sun some of its surface ice vaporizes and the resulting vapour and the dust particles that were stuck in the ice fly away from the sun forming the coma and the tails. This is the reason for tails of comet always pointing away from sun.
Did you ever wonder how comets are formed?
First of all comet is a very big chunk of rock with a long tail which comes at great speed by the gravity of the sun.
Scintists are not sure that how are comets formed. They say that it is formed in a cloud known as oort cloud.
A comet orbits a star. It is made up of frozen gas and ice. Its because of solar wind (your second question)