Barrier options are one of the most popular forms of path-dependent options. They provide the appropriate hedge in a number of situations and are at the same time less expensive than the corresponding standard options. In this paper we introduce a large class of double-barrier options that include the existing options either as a particular or as a limiting case. We provide a general valuation method for these options and illustrate the methodology with many examples. Our approach is based on a certain infinite-series representation of the exit times densities, which is not new but which we prove in a new way by utilizing directly a generalized version of the Lévy formula proven by Kunitomo and Ikeda (1992). Although, in general, the pricing formulae require one-dimensional numerical integration, in practice they are easy to use. In addition, there are cases where the numerical integration can be avoided, which we illustrate by giving some examples.