Application of physical and chemical concepts, complemented by studies of prokaryotes in ice cores and permafrost, has led to the present understanding of how microorganisms can metabolize at subfreezing temperatures on Earth and possibly on Mars and other cold planetary bodies. The habitats for life at subfreezing temperatures benefit from two unusual properties of ice. First, almost all ionic impurities are insoluble in the crystal structure of ice, which leads to a network of micron-diameter veins in which microorganisms may utilize ions for metabolism. Second, ice in contact with mineral surfaces develops a nanometre-thick film of unfrozen water that provides a second habitat that may allow microorganisms to extract energy from redox reactions with ions in the water film or ions in the mineral structure. On the early Earth and on icy planets, prebiotic molecules in veins in ice may have polymerized to RNA and polypeptides by virtue of the low water activity and high rate of encounter with each other in nearly one-dimensional trajectories in the veins. Prebiotic molecules may also have utilized grain surfaces to increase the rate of encounter and to exploit other physicochemical features of the surfaces.