Quantum theory of noise in gas and solid state lasers with an inhomogeneously broadened line. I