The prediction of high pressure phases of a chemical system is realized as a two-step process: identification of structure candidates through the global exploration of their energy landscapes over a range of different pressures, followed by a limited local optimization using ab initio methods. The application of this recipe is presented for several systems, Li3N, Na3N, LixNa(6 - x)N2 (x = 1,...,5), Li2S and Na2S. We find that at standard pressure, the optimal configurations for the binary end compositions of the alkali nitrides, Li3N and Na3N, exhibit the Li3N and Li3P structures, respectively. Among the ternary compounds, the compositions with x = 2 and x = 4 are preferred, the optimal structures being ternary variations of the Li3N structure type. At moderately high pressures, phase transitions from Li3N to Li3Bi related structures are predicted for all ternary compounds, while Na3N and Li3N exhibit transitions from Li3P to Li3Bi and Li3N via Li3P to Li3Bi, respectively. The analogous study of the landscapes of Li2S and Na2S shows that a sequence of phase transitions from the CaF2 structure via the PbCl2 structure to the Ni2In structure is expected.