The electromagnetic prospecting problem requires fine gridding to account for sea bottom and to model complicated targets. This results in large computational costs using conventional finite-difference solvers. To circumvent these problems, we employ a volume integral equation approach for preconditioning and to eliminate the background, thus significantly reducing the condition number and dimensionality of the problem. Since the problem should be solved in unbounded domain we use so-called optimal grids to truncate error of approximation at infinity. Special averaging procedure is proposed to account for inhomogenuity. Theory and numerical results will be presented.