We extend a microscopic theory of polarization and magnetization to include the spin degree of freedom of the electrons, introducing a general spin-orbit coupling and Zeeman interaction term in the Hamiltonian. At finite frequencies and including spin, the magnetoelectric polarizability tensor is replaced by two separate tensors, one that relates the polarization P to the magnetic field B and a separate tensor that relates the magnetization M to the electric field E. When combined with other relevant response tensors a third-rank tensor that relates the induced current density to gradients in the electric field can be introduced; it is gauge invariant, in a form suitable for numerical calculations, and describes optical activity---including spin effects---even in materials that may lack time-reversal symmetry.