A combination of first-principle and thermochemical calculations is applied to compute the phase diagrams of rhenium-nitrogen and of ruthenium-nitrogen at elevated temperature and high pressure. We augment total energy calculations with our approach to treat the nitrogen fugacity at high pressures. We predict a sequential nitridation of Re at high-pressure/high-temperature conditions. At 3000 K, ReN will form from Re and nitrogen at about 32 GPa. A ReN2 with CoSb2-type structure may be achieved at pressures exceeding 50 GPa at this temperature. Marcasite-type RuN2 will be attainable at 3000 K at pressures above 30 GPa by reacting Ru with nitrogen.