A theoretical analysis is made of unsteady doubling of optical frequencies in nonlinear media with random inhomgeneities. It is shown that such inhomogeneities cause an additional reduction in the intensity and broadening of the harmonic spectrum, compared with unsteady generation in homogeneous nonlinear media. The theory is applied to the multiplication of frequencies of picosecond pulses in nonlinear crystals and to the generation of harmonics in a laser plasma.