Solar wind and sunlight push comet dust and gas outward, so the tail points away from the Sun regardless of travel direction.