The tail of a comet is made of gas pushed away from the nucleus by something outside the comet. To find the direction of the tail, ask where that push comes from.
A comet moves away from the Sun on its way out of the inner Solar System. In which direction does its tail of ionised gas point?