The theory of speckle noise in a scanning beam is presented. The general formulas for the calculation of speckle contrast, which apply to any scanning display, are obtained. It is shown that the main requirement for successful speckle suppression in a scanning display is a narrow autocorrelation peak and low sidelobe level in the autocorrelation function of the complex amplitude distribution across a scanning light beam. The simple formulas for speckle contrast for a beam with a narrow autocorrelation function peak were obtained. It was shown that application of a diffractive optical element (DOE) with a Barker code phase shape could use only natural display scanning motion for speckle suppression. DOE with a Barker code phase shape has a small size and may be deposited on the light modulator inside the depth of the focus of the reflected beam area, and therefore, it does not need an additional image plane and complicated relay optics.