The thermodynamic modeling and optimization of the Ce-Mg, Ce-Y, Mg-Nd, Nd-Y, Ce-Mg-Y and Mg-Nd-Y systems have been carried out by means of the CALPHAD technique. The solution phases, liquid, body-centered cubic, face-centered cubic, hexagonal close-packed and double hexagonal close-packed, were described by the substitutional solution model. The isostructural MgCe, MgNd and MgY phases with B2 structure form continuous range of solid solutions in the Ce-Mg-Y and Mg-Nd-Y ternary systems. The order-disorder transition between the solutions with A2 structure and compounds with B2 structure in the systems has been taken into account and thermodynamically modeled. The other compounds Mg 2 Y, Mg 24 Y 5 , Mg 3 R, Mg 41 R 5 , Mg 2 R and Mg 12 Ce (R = Ce and Nd) in the Mg-R-Y system exhibit different solubilities of the third component. A set of self-consistent thermodynamic descriptions of the Ce-Mg-Y and Mg-Nd-Y systems was obtained.