The reverberation-ray matrix method is extending to the vibration analysis of pile-foundation systems.The Matlab language programm is used to solve the two-dimensional complex transcendental equation with the help of the root method. Through numerical examples, the effects of the exposed length, the depth and the constraint of the pile on the natural frequency, attenuation coefficient and modality are compared and analyzed in the viscoelastic foundation. The results show that the natural frequency and attenuation coefficient of the embedded structure decreases with the increase of the exposed length. When the buried depth decreases in the embedded structures, the natural frequency decreases and the attenuation coefficient increases. The transverse displacement of the buried part is obviously smaller than that of the exposed part. The natural frequency of the pile under the fixed top boundary is the largest, the attenuation coefficients of the pile under the free top boundary is the smallest. The vibration amplitude of the free top of the pile is smaller than that of the hinge top and the fixed top.