As a comet approaches the Sun, the Sun's heat causes its ice to sublime, releasing gas and dust. The solar wind (a stream of charged particles from the Sun) and solar radiation pressure push this material away from the comet's nucleus, forming the tail(s). Because these forces emanate from the Sun, the tail is always directed away from the Sun, regardless of the comet's direction of motion in its orbit.