Statistical theory of the decay of metastable states