An ill-posed Cauchy problem for a 3D elliptic partial differential equation with variable coefficients is considered. A well-posed quasi-boundary-value (QBV) problem is given to approximate it. Some stability estimates are given. For the numerical implementation, a large sparse system is obtained from discretizing the QBV problem using the finite difference method. A left-preconditioned generalized minimum residual method is used to solve the large system effectively. For the preconditioned system, a fast solver using the fast Fourier transform is given. Numerical results show that the method works well.