Answer:
Comets leave long beautiful tails when they come close to the sun. ... But when it approaches the sun, the heat evaporates the comet's gases, causing it to emit dust and microparticles (electrons and ions). These materials form a tail whose flow is affected by the sun's radiation pressure.
Explanation: I just searched it up on the internet lol.