The switching of magnetic layers is studied under the action of a spin curr
ent in a ferromagnetic metal-nonmagnetic metal-ferromagnetic metal spin val
ve. We find that the main contribution to the switching comes from the none
quilibrium exchange interaction between the ferromagnetic layers. This inte
raction defines the magnetic configuration of the layers with minimum energ
y and establishes the threshold for a critical switching current. Depending
on the direction of the critical current, the interaction changes sign and
a given magnetic configuration becomes unstable. To model the time depende
nce of the switching process, we derive a set of coupled Landau-Lifshitz eq
uations for the ferromagnetic layers. Higher order terms in the nonequilibr
ium exchange coupling allow the system to evolve to its steady-state config
uration.