The Rayleigh number describes the behaviour of fluids (such as water or air) when the mass density of the fluid is non-uniform. The mass density differences are usually caused by temperature differences. Typically a fluid expands and becomes less dense as it is heated. Gravity causes denser parts of the fluid to sink, which is called convection. Lord Rayleigh studied the case of Rayleigh-Bénard convection. When the Rayleigh number, Ra, is below a critical value for a fluid, there is no flow and heat transfer is purely by conduction; when it exceeds that value, heat is transferred by natural convection.
When the mass density difference is caused by temperature difference, Ra is, by definition, the ratio of the time scale for diffusive thermal transport to the time scale for convective thermal transport at speed :
This means the Rayleigh number is a type of Péclet number. For a volume of fluid of size  in all three dimensions and mass density difference , the force due to gravity is of the order , where  is acceleration due to gravity. From the Stokes equation, when the volume of fluid is sinking, viscous drag is of the order , where  is the dynamic viscosity of the fluid. When these two forces are equated, the speed . Thus the time scale for transport via flow is . The time scale for thermal diffusion across a distance  is , where  is the thermal diffusivity. Thus the Rayleigh number Ra is
where we approximated the density difference  for a fluid of average mass density , thermal expansion coefficient  and a temperature difference  across distance .
The Rayleigh number can be written as the product of the Grashof number and the Prandtl number: