On the temperature and gas composition in the region of comet formation