Using linear perturbation theory, we investigate the torque exerted on a low-mass planet embedded in a gaseous protoplanetary disc with finite thermal diffusivity. When the planet does not release energy into the ambient disc, the main effect of thermal diffusion is the softening of the enthalpy peak near the planet, which results in the appearance of two cold and dense lobes on either side of the orbit, of size smaller than the thickness of the disc. The lobes exert torques of opposite sign on the planet, each comparable in magnitude to the one-sided Lindblad torque. When the planet is offset from corotation, the lobes are asymmetric and the planet experiences a net torque, the `cold thermal torque, which has a magnitude that depends on the relative value of the distance to corotation to the size of the lobes $simsqrt{chi/Omega_p}$, $chi$ being the thermal diffusivity and $Omega_p$ the orbital frequency. We believe that this effect corresponds to the phenomenon named `cold finger recently reported in numerical simulations, and we argue that it constitutes the dominant mode of migration of sub-Earth-mass objects. When the planet is luminous, the heat released into the ambient disc results in an additional disturbance that takes the form of hot, low-density lobes. They give a torque, named heating torque in previous work, that has an expression similar, but of opposite sign, to the cold thermal torque.