  A novel time domain solver of Maxwell's equations in passive (dispersive and
absorbing) media is proposed. The method is based on the path integral
formalism of quantum theory and entails the use of ({\it i}) the Hamiltonian
formalism and ({\it ii}) pseudospectral methods (the fast Fourier transform, in
particular) of solving differential equations. In contrast to finite
differencing schemes, the path integral based algorithm has no artificial
numerical dispersion (dispersive errors), operates at the Nyquist limit (two
grid points per shortest wavelength in the wavepacket) and exhibits an
exponential convergence as the grid size increases, which, in turn, should lead
to a higher accuracy. The Gauss law holds exactly with no extra computational
cost. Each time step requires $O(N\log_2 N)$ elementary operations where $N$ is
the grid size. It can also be applied to simulations of electromagnetic waves
in passive media whose properties are time dependent when conventional
stationary (scattering matrix) methods are inapplicable. The stability and
accuracy of the algorithm are investigated in detail.
