We investigate a repulsion mechanism between two low-mass planets migrating in a protoplanetary disk, for which the relative migration switches from convergent to divergent. This mechanism invokes density waves emitted by one planet transferring angular momentum to the coorbital region of the other and then directly to it through the horseshoe drag. We formulate simple analytical estimates, which indicate when the repulsion mechanism is effective. One condition for a planet to be repelled is that it forms a partial gap in the disk and another is that this should contain enough material to support angular momentum exchange with it. Using two-dimensional hydrodynamical simulations we obtain divergent migration of two super-Earths embedded in a protoplanetary disk because of repulsion between them and verify these conditions. To investigate the importance of resonant interaction we study the migration of planet pairs near first-order commensurabilities. It appears that proximity to resonance is significant but not essential. In this context we find repulsion still occurs when the gravitational interaction between the planets is removed sugesting the importance of angular momentum transfer through waves excited by another planet. This may occur through the scattering of coorbital material (the horseshoe drag), or material orbiting close by. Our results indicate that if conditions favor the repulsion between two planets described above, we expect to observe planet pairs with their period ratios greater, often only slightly greater, than resonant values or possibly rarity of commensurability.