Due to refracted light from the planet's atmosphere, a comet's tail turns colourful as it just misses the planet.