Dani Pedrosa took his third victory of the season in an eventful race at the Twin Ring Motegi circuit with Jorge Lorenzo second and Casey Stoner third.