This paper is concerned with the efficient numerical solution of the Lyapunov equation AT X +XA = -C with a stable matrix A and a symmetric positive semidefinite matrix C of possibly small rank. We discuss the efficient implementation of Hammarling's method and propose among other algorithmic improvements a block variant, which is demonstrated to perform significantly better than existing implementations. An extension to the discrete-time Lyapunov equation AT XA - X = -C is also described.