Rayleigh–Bénard convection, i.e. the flow of a fluid between two parallel plates that is driven by a temperature gradient, is an idealised set-up to study thermal convection. Of special interest are the statistics of the turbulent temperature field, which we are investigating and comparing for three different geometries, namely convection with periodic horizontal boundary conditions in three and two dimensions as well as convection in a cylindrical vessel, in order to determine the similarities and differences. To this end, we derive an exact evolution equation for the temperature probability density function. Unclosed terms are expressed as conditional averages of velocities and heat diffusion, which are estimated from direct numerical simulations. This framework lets us identify the average behaviour of a fluid particle by revealing the mean evolution of a fluid with different temperatures in different parts of the convection cell. We connect the statistics to the dynamics of Rayleigh–Bénard convection, giving deeper insights into the temperature statistics and transport mechanisms. We find that the average behaviour is described by closed cycles in phase space that reconstruct the typical Rayleigh–Bénard cycle of fluid heating up at the bottom, rising up to the top plate, cooling down and falling again. The detailed behaviour shows subtle differences between the three cases.