A stochastic theory of second order optical processes