Time–domain Maxwell's equations are studied for the electromagnetic scattering of plane waves from an arbitrarily shaped cavity filled with nonhomogeneous medium. A transparent boundary condition is introduced to reduce the problem to the bounded cavity. Existence and uniqueness of the model problem are established by a variational approach and the Hodge decomposition. The analysis forms a basis for numerical solution of the model problem.