Laser ultrasonic technique is used for the nondestructive testing technology of surface damage, but ignores the density variation in the sample. Photoacoustic elastography is adopted to obtain more rail information (such as the internal defects, the variation of sample's interior density) of the sample by collecting Rayleigh wave on rail surface and shear wave within the rail. In this paper, it is proved that the internal defects and the variation of density can be detected by photoacoustic elastography, using finite element analysis (FEA). We first use FEA to simulate the ultrasound excitation on the steel material surface excited by the laser source. Two cases of sample are modeled and analyzed, one is with defects of different depth and the other is with different density. Then, an isotropic model using ANSYS is employed and shear wave propagation is modeled. The preliminary results successfully recapitulate the trend of the change of shear wave's velocities, which shows that the defects can enhance the amplitude of shear wave. In addition, the velocities of shear wave would increase when the density of the sample enlarges. Results from computer simulations demonstrate the effectiveness of photoacoustic elastography with application to quantitative analysis for the structures of sample.