Bacteria of the genera Pseudomonas and Bacillus can promote plant growth and protect plants from pathogens. However, the interactions between these plant-beneficial bacteria are understudied. Here, we explore the interaction between Bacillus subtilis 3610 and Pseudomonas chlororaphis PCL1606. We show that the extracellular matrix protects B. subtilis colonies from infiltration by P. chlororaphis. The absence of extracellular matrix results in increased fluidity and loss of structure of the B. subtilis colony. The P. chlororaphis type VI secretion system (T6SS) is activated upon contact with B. subtilis cells, and stimulates B. subtilis sporulation. Furthermore, we find that B. subtilis sporulation observed prior to direct contact with P. chlororaphis is mediated by histidine kinases KinA and KinB. Finally, we demonstrate the importance of the extracellular matrix and the T6SS in modulating the coexistence of the two species on melon plant leaves and seeds.