A gas can go through two different state changes. If the temperature is low enough the gas can condense and turn into a liquid. Sometimes, if the temperature is low enough it can go through deposition, where it changes straight to a solid. Normally a gas must first condense to a liquid, and then freeze to become a solid, but if the temperature is very low it can skip the liquid stage and instantly become solid. Frost on the ground in winter is caused by this. Water vapour (a gas) goes into the air which is very cold, and instantly becomes ice due to deposition.