There is a classic meditative procedure in Tibetan Buddhism for cultivating compassion, called "exchange of self for others," where you imagine putting yourself in the place of the victim. You switch positions.

His Holiness The Dalai Lama, Destructive Emotions by Daniel Goleman