In order to investigate the spectrum effect in density gaining, an ideal radiography has been simualted with Monte Carlo (MC) method. Three kinds of mass attenuation coefficient(MAC) have been used, which are the monoenergetic MAC at the mean energy of the MC simulated spetrum, the effective MAC of the Born approximation formula spectrum(BS) and the effective MAC of the MC simulated spectrum. The results show that if the spectrum effective MAC is used, the spectrum effect decreases obviously. The root-mean-square error of the density may be less then 1.5% with the effective MAC of the BS. Better result is gained with the effective MAC of the MC simulated spectrum.