The finite-time ruin problem, which implicitly involves the inversion of the Laplace transform of the time to ruin, has been a long-standing research problem in risk theory. Existing results in the Sparre Andersen risk models are mainly based on an exponential assumption either on the interclaim times or on the claim sizes. In this paper, we utilize the multivariate version of Lagrange expansion theorem to obtain a series expansion for the density of the time to ruin under a more general distribution assumption, namely the combination of n exponentials. A remark is further made to emphasize that this technique can also be applied to other areas of applied probability. For instance, the proposed methodology can be used to obtain the distribution of some first passage times for particular stochastic processes. As an illustration, the duration of a busy period in a queueing risk model will be examined.