Scattering of an electromagnetic wave in a one-dimensional medium with an arbitrary index of refraction