Conversion between gas and solid phases