A recently developed FORTRAN program computing far-field optical observables for spherical particles in an absorbing medium has exhibited numerical instability arising when the product of the particle vacuum size parameter and the imaginary part of the refractive index of the host becomes sufficiently large. We offer a simple analytical explanation of this instability and propose a compact numerical algorithm for the stable computation of Lorenz–Mie coefficients based on an upward recursion formula for spherical Hankel functions of a complex argument. Extensive tests confirm an excellent accuracy of this algorithm approaching machine precision. The improved public-domain FORTRAN program is available at https:// www.giss.nasa.gov/staff/mmishchenko/Lorenz-Mie.html.