Coherent electronic transport through a molecular device is studied using non-equilibrium Green's function (NEGF) formalism. Such device is made of atomic nanowire which is connected to ferromagnetic electrodes. The molecule itself is described with the help of Hubbard model (Coulomb interactions are treated by means of the Hartree-Fock approximation), while the coupling to the electrodes is modeled through the use of a broad-band theory. It was shown that magnetoresistance varies periodically with increasing length of the atomic wire (in the linear response regime) and oscillates with increasing bias voltage (in the nonlinear response regime). Since the TMR effect for analyzed structures is predicted to be large (tens of percent), these junctions seem to be suitable for application as magnetoresistive elements in future electronic circuits.