A novel three-dimensional time domain method is developed to study interactions between finite-sized electromagnetic sources and infinite periodic structures. The method is based on a periodic finite difference time domain method combined with the spectral expansion of electromagnetic sources. Using this method, only a single periodic cell needs to be modeled in finite difference time domain simulations. The convergence, guidelines on using the algorithm, and the acceleration scheme for the algorithm are discussed. Several periodic structures are simulated by this proposed method. It is shown that this method can significantly reduce the required computer memory and computational time.