Heat transfer resulting from the natural convection in a fluid layer contained in an infinite horizontal slot bounded by solid walls and subject to a spatially periodic heating at the lower wall has been investigated. The heating produces sinusoidal temperature variations along one horizontal direction characterized by the wave number α with the amplitude expressed in terms of a suitably defined Rayleigh number Rap. The maximum heat transfer takes place for the heating with the wave numbers α = 0(1) as this leads to the most intense convection. The intensity of convection decreases proportionally to α when α→0, resulting in the temperature field being dominated by periodic conduction with the average Nusselt number decreasing proportionally to α2. When α→∞, the convection is confined to a thin layer adjacent to the lower wall with its intensity decreasing proportionally to α−3. The temperature field above the convection layer looses dependence on the horizontal direction. The bulk of the fluid sees the thin convective layer as a “hot wall.” The heat transfer between the walls becomes dominated by conduction driven by a uniform vertical temperature gradient which decreases proportionally to the intensity of convection resulting in the average Nusselt number decreasing as α−3. It is shown that processes described above occur for Prandtl numbers 0.001 < Pr < 10 considered in this study.