What happens as a comet approaches and moves away from the sun?

As a comet approaches towards the sun it becomes warm. Then as it moves away from the sun, it forms a glowing tail and extends over 100 million km.

Please tell me if this is correct, thanks

Farthest from the sun, the comet would have no tail. The tail would become prominent closer to the sun, because the solar radiation vaporizes parts of the comet. The tail always points away from the sun.

I hope this helps.