The free vibration and buckling of functionally graded carbon nanotube reinforced composite beams with variable thickness resting on elastic foundations are investigated in the present paper. To account rotary inertia and transverse shear deformation effects, the Timoshenko beam theory is employed and governing equations are derived using Hamilton's principle. The obtained equations are solved using generalized differential quadrature method. Different carbon nanotube distributions through the thickness are considered, and the rule of mixture is used to describe the effective material properties of the functionally graded reinforced beams. The results are validated with available investigations, and the effects of boundary conditions, nanotube volume fraction and distribution, foundation and thickness ratio on both natural frequency and buckling load are studied. Finally, due to the weight optimization in aerospace and turbomachinery applications, the optimum beam shape and nanotube distribution are suggested to achieve the most capacity of bearing axial loads with fixed weight.