Thermoelastic martensitic transformations play a fundamental role in the shape memory effect and related phenomena. Owing to their unique crystallographic and thermomechanical behaviour, martensitic transformations have generated considerable research in the areas of crystallography, thermodynamics and mechanical behaviour. In the area of thermodynamics a theoretical approach is now added which provides the basis for thermoelastic behaviour through consideration of the Gibbs energy change. In this paper, the interrelation of internal elastic stresses and martensite shear stresses in phase transitions has been defined. A thermoelastic stress equilibrium equation for a wide range of martensitic transformation temperatures has been presented. On the basis of the calculations made, an estimation of dislocation defects formation energy for the TiNi-based alloy has been made. For TiNi-based composition made of TN-10 brand alloy, commercially produced for medical goals, the energy of vacancy formation is about 0.06 kcal/mol. The study and calculations are shown to make clear, using a new approach, the considering of phase transitions in terms of external and internal stresses.