We develop a theory of first passage processes in stochastic nonequilibrium systems of birth-death type using two closely related epidemiological models as examples. Our method employs the probability generating function technique in conjunction with the eikonal approximation. In this way the problem is reduced to finding the optimal path to extinction: a heteroclinic trajectory of an effective multidimensional classical Hamiltonian system. We compute this trajectory and mean extinction time of the disease numerically and uncover a nonmonotone, spiral path to extinction of a disease. We also obtain analytical results close to a bifurcation point, where the problem is described by a Hamiltonian previously identified in one-species population models.