In this study, an improved finite element method is presented which can be used to analyse the transverse and axial vibrations of the functionally graded material (FGM) beams in a thermal environment and exposed to a mass moving at variable speed. The motion equations of the FGM beam were obtained using first order shear deformation theory (FSDT). In these equations, the interaction terms of the mass inertia are derived from the exact differential of the displacement functions of the beam relative to the mass contact point. For various temperature loads (homogeneous, linear and non-linear), thermal stresses are converted to mechanical stresses and then the thermal rigidity matrix is combined with the stiffness matrix of the beam. After verification of the method, the novel findings of the interaction of the moving mass with the FGM beam in different ceramic and metallic compositions are presented for uniform, linear and non-linear thermal loads and the variable speed of the mass.