In front of Ditto, use aPokemon with the ability Pressure.
This way, when Ditto uses Transform, and gets 5/n PP of our moves, we can quickly end the foe Ditto's PP supply.
This makes Ditto start using Struggle faster, and the recoil finishes it off, if you do not.
Good Pokemon for this : Spiritomb, which can resist most of its own attacks.
Beware of Leppa Berries.
Happy Ditto Annoying. :)