The stability characteristics of an infinite horizontal fluid layer excited by a time-periodic, sinusoidally varying free-boundary temperature, have been investigated numerically using the Floquet theory. It has been found that the modulation of the temperature gradient across the fluid layer affects the onset of the Rayleigh–Bénard convection. Modulation can give rise to instability in the subcritical conditions and it can also suppress the instability in the supercritical cases. The instability in the fluid layer manifests itself in the form of either a harmonic or subharmonic flow, controlled by thermal modulation.