We show how tuning the proximity to the soft optical mode phase transition via chemical composition affects the lattice thermal conductivity κ of Pb1−xGexTe alloys. Using first-principles virtual-crystal simulations, we find that the anharmonic contribution to κ is minimized at the phase transition due to the maximized acoustic-optical anharmonic interaction. Mass disorder significantly lowers and flattens the dip in the anharmonic κ over a wide composition range, thus shifting the κ minimum away from the phase transition. The total κ and its anharmonic contribution vary continuously between the rocksalt and rhombohedral phases as expected for the second-order phase transition. The actual phase and its strength of resonant bonding play a less prominent role in reducing the κ of Pb1−xGexTe alloys than the proximity to the phase transition and the atomic mass. Our results show that alloys with soft optical mode transitions are promising materials for achieving low thermal conductivity and possibly high thermoelectric efficiency.