A light pulse propagating in a suddenly switched-on photonic lattice, when the central frequency lies in the photonic bandgap, is an analog of the Rabi model, where the two-level system is the two resonant (i.e., Bragg-coupled) Fourier modes of the pulse, while the photonic lattice serves as a monochromatic external field. A simple theory of this Rabi oscillations is given and confirmed by the numerical solution of the corresponding Maxwell equations. This is a direct, i.e., temporal analog of the Rabi effect, additionally to the spatial analog in optical beam propagation described previously [Opt. Lett.32, 1920 (2007)]. An additional high-frequency modulation of the Rabi oscillations reflects the lattice-induced energy transfer between the electric and magnetic fields of the pulse.