Computer simulations in the framework of the Density Functional Theory have become an established tool for computer simulations of materials properties. In most cases, however, information is obtained at ambient conditions, preventing design of materials for applications at extreme conditions. In this work we employ ab initio calculations to investigate the influence of stresses on structure and stability of Ti-Mo and Zr-Nb alloys, an important class of construction materials. Calculations reproduce known phase stability trends in these systems, and we resolve the controversy regarding the stability of body-centered cubic solid solution in Mo-rich Ti-Mo alloys against the isostructural decomposition. Calculated results are explained in terms of the electronic structure effects, as well as in terms of physically transparent thermodynamic arguments that relate phase stability to deviations of concentration dependence of atomic volume from the linear behavior.