The nucleus of the comet is essentially the 'heart' of the comet, containing the primitive material preserved over billions of years. The nucleus of a comet is a solid object a few kilometers across comprised of water ice mixed withh dust and silicate grains. As a comet nears the Sun, solar radiation warms the nucleus, thereby causing the ices to sublime off the nucleus, allowing the dust grains to escape. The solar winds, which are radial flows of plasma leaving the sun, then cause the dust grains to be ejected in a path away from the sun. This process is what creates both a coma as well as the tail of a comet.
Dust tails consist of dust particles which have streamed of the nucleus by escaping gasses.
The ion tail consists of plasma which is ionized matter and is laced with rays and streamers caused by interactions with the solar winds. Comets are most probably the remnant materal left over from the formation of the solar system some 4.6 billion years ago. There is no evidence which tends to suggest that comets originated outside of the Solar System, between the stars. If indeed comets were formed at the same time our Solar System was born, the theory of the formation of cometary nuclei may also be the same theory as to the formation of our Solar System. If this is the case, the study of comets may offer a glimse into examining the initial conditions out of which our Solar System formed.