The generalized planar fault energies, Rice criterion ductility, and twinnability of pure Mg and Mg-RE (RE = Er, Ho, Dy, Tb, and Gd) alloys at different temperature have been investigated using density functional theory. It is shown that all the fault energies and twinnability in the same materials decrease with increasing temperature. However, the ductility has the opposite change trend. On the other hand, alloying rare earth elements will generally decrease the fault energies and increase the ductility and twinnability of Mg at different temperature. It is interesting to note that alloying larger atomic radius will enhance the ductility of Mg more easily and alloying smaller radius will make twinning tendency of Mg more easily. Finally, the electron structure further reveals the underlying mechanisms for the reduction of fault energies with the addition of rare earth elements.