We present an analytic description of the finite-temperature phase diagram of the Bose-Hubbard model, successfully describing the physics of cold bosonic atoms trapped in optical lattices and superlattices. Based on a standard statistical mechanics approach, we provide the exact expression for the boundary between the superfluid and the normal fluid by solving the self-consistency equations involved in the mean-field approximation to the Bose-Hubbard model. The zero-temperature limit of such result supplies an analytic expression for the Mott lobes of superlattices, characterized by a critical fractional filling.