Magnesium alloys have a high mechanical rigidity and an extremely low density. They attract car manufacturers to meet the standards US EPA CAFE (Corporate Average Fuel Economy), and to replace many materials, such as copper alloys, cast irons and steels, and also aluminum alloys. Recently, mechanical and thermal properties of magnesium alloys with rare earth elements and Zn have been studied in scientific research, this is the reason for the manufacture of pistons from Mg-Zn (Y, Gd) alloys. In this work, we present numerical simulations 3D finite element, to characterize by a non-destructive method (infrared thermography) subsurface cracks that may occur in the heads of pistons magnesium alloys Mg-Zn (Y, Gd). The thermal images of the heads of vehicle engine pistons show the capability of the infrared thermography not in the detection but also in the characterization of cracks under surface.