We study the transition from the full quantum mechanical description of physical systems to an approximate classical stochastic one. Our main tool is the identification of the closed-time-path (CTP) generating functional of Schwinger and Keldysh with the decoherence functional of the consistent histories approach. Given a degree of coarse graining in which interferences are negligible, we can explicitly write a generating functional for the effective stochastic process in terms of the CTP generating functional. This construction gives particularly simple results for Gaussian processes. The formalism is applied to simple quantum systems, quantum Brownian motion, and quantum fields in curved spacetime. Perturbation theory is also explained. We conclude with a discussion on the problem of the back-reaction of quantum fields in spacetime geometry.