He waited until yami marik fuses himself with ra and then used ragnarok to negate and destroy Ra, because of that , with odion's help, marik switched with yami marik in the duel, and then marik surrendered to trap his dark counterpart in the shadows.