Two segments of a comet are head and tail.
Head is main part of comet. Depending on how comet was created head can be made out of metal (such as iron) or stone. Also, head contains a lot of dust and water ice. When comet comes closer to Sun it's surface warms and ice starts to melt. Due to low pressure in space it almost instantly evaporates creating water vapour. This vapour causes the particles of dust to raise above surface of head and to fall back of the head.
Tail is most viewed part of a comet. It best something that we can see with naked eye and that helps us to distinguish comet and all other celestial bodies. Tail is made out of two other tails. First is dust tail. It is created when dust particles rise from head of a comet and fall behing it. Gravity of a comet causes for these particles to follow head. Dust tail is always located opposite to direction of movement. Second tail is ionic tail. When solar particles (such as solar wind) hit comet they ionize atoms and molecules. This causes them to glow and produce light which we can see. Ionic tail is always opposite to direction in which Sun is located. When comet is far from Sun dust and ionic tail lay in same position. When comet is close to Sun dust and ionic tail not always lay in same position.