It becomes gas.
Comets are objects composed mostly of ice and dust that grow tails when they approach the sun. All comets have a nucleus, which is the hard rock/ice object. When a comet nucleus nears the sun, solar energy begins to heat the ice and vaporize it.