Quantum theory of dynamic magnetoresistance