  It was shown that according to the non-linear electrodynamics of vacuum
electromagnetic rays should bend in the field of magnetic dipole. The angles of
ray bending in the gravitational and magnetic fields of pulsars and magnetars
were obtained. In the case of pulsars with $b\sim R\sim $ 100 km, $B_0\sim
10^{13} G$ the value of the angle of non-linear electrodynamic bending of a ray
in the Heisenberg-Euler theory will reach the value of $\delta \psi_{NED}\sim
30'',$ and in the case of a magnetar with $B_0\sim 10^{15} G$ the angle $\delta
\psi_{NED}$ will increase to $\delta \psi_{NED}\sim 1 rad\sim 60^\circ .$ The
angle of gravitational bending of a ray at neutron star with $r_g$ = 3 km in
the same conditions will be equal to $\delta \psi_g\sim 0.06$ rad $\sim 4^\circ
>.$ Observations can only be made in X- rays and gamma-rays, for which the
agnetosphere is quite opaque. Because the distance from the Earth to the
well-known pulsars and magnetars is too large to observe the pure effect of a
ray bending. The non-linear electrodynamic bending of a ray as well as the
gravitational bending will be revealed in the effect of lensing.
