A new Monte Carlo program that simulates the full X-ray spectrum, including
the characteristic lines and the background, has been developed for specim
en having rough surfaces. It is reported that the shape and the intensity o
f the X-ray spectrum are a strong function of the beam position. These vari
ations are related to the change of generation and absorption of X-rays as
the beam is moved across a rough surface.