Heating a solid sphere at the surface induces mechanical stresses inside the sphere. If a finite amount of heat is supplied, the stresses gradually disappear as temperature becomes homogeneous throughout the sphere. We show that before this happens, there is a temporary lowering of pressure and density in the interior of the sphere, inducing a transient lowering of the temperature here. For ordinary solids this effect is small because cp ∼ = cV . For fluent liquids the effect is negligible because their dynamic shear modulus vanishes. For a liquid at its glass transition, however, the effect is generally considerably larger than in solids. This paper presents analytical solutions of the relevant coupled thermoviscoelastic equations. In general, there is a difference between the isobaric specific heat, cp, measured at constant isotropic pressure and the longitudinal specific heat, c l , pertaining to mechanical boundary conditions that confine the associated expansion to be longitudinal. In the exact treatment of heat propagation the heat diffusion constant contains c l rather than cp. We show that the key parameter controlling the magnitude of the "cooling-by-heating" effect is the relative difference between these two specific heats. For a typical glass-forming liquid, when temperature at the surface is increased by 1 K, a lowering of the temperature in the sphere center of order 5 mK is expected if the experiment is performed at the glass transition. The cooling-by-heating effect is confirmed by measurements on a 19 mm diameter glucose sphere at the glass transition.PACS numbers: