We study the distribution, morphology, and geometrical properties of fractures in several young impact melt deposits on the Moon and Mercury, and the ways that these fractures may form from cooling by thermal radiation. In each impact melt complex, the topography of the underlying terrain determines the orientation of cooling fractures, such that interior fractures that formed in the relatively thick interior areas of the melt unit are wider and have a larger spacing than marginal fractures that formed in the relatively thin areas near the unit's margins. Solid debris entrained in molten deposits provides prefracture flaws that can seed cooling fractures, but too much solid debris prevents cooling fractures from growing to macroscopic sizes. The appearance of subparallel fractures is mainly caused by subsidence of the deposits during the process of cooling and solidification. Tensile stresses caused by thermal radiation are large enough to initiate cooling fractures on both the Moon and Mercury, which may represent the initial stage of columnar joints formation, but the cooling rate caused solely by thermal radiation is not large enough to form well-organized columnar joints that feature polygonal colonnades. We therefore propose that thermal conduction and convection are the major contributors in the formation of columnar joints on planetary bodies.