Lazarus' race discovered an alternative warp that led to a dimension composed of anti-matter, where everything was duplicated. The knowledge that another version of his existed in the other universe drove Lazarus insane and he determined to destroy his counterpart, even though he knew that encountering him outside of the corridor between universes would destroy both their dimensions.
Lazarus encountered the Enterprise crew on a desolate planet where they were investigating breaches in reality caused by his experiments. He told them that he was pursuing an evil monster who had destroyed his civilisation and that he had pursued his opponent through time and space. He had a timeship that would allow him to cross between dimensions but needed a way to power it.
Discovering that the Enterprise's dilithium crystals were compatible, Lazarus plotted to steal some from the ship. His counterpart, who he periodically changed places with, attempted to sabotage his efforts but Lazarus succeeded in making it back to the planet with the crystals. Kirk pursued him and ended up being transported to the other dimension by the machine. There, he encountered the sane, anti-matter version of Lazarus and the two of them hatched a plan. Kirk returned to his own dimension and sent Lazarus into the corridor between dimensions where his counterpart was waiting for him. He and his crew then destroyed the machine, which destroyed its counterpart in the other dimension. The two Lazaruses were thus sealed in the corridor forever, to spend eternity at each other's throats.
Actor John Drew Barrymore was contracted to play Lazarus but failed to turn up to filming. Robert Brown was drafted as a very last minute replacement with recording already started.