The right-handed Qualls (4-8, 3.11 ERA) has been the best pitcher out of an otherwise shaky bullpen of late. He has not allowed a run in 17 of his last 18 appearances and has a 1.02 ERA since the All-Star break.
"He's picked up a lot of confidence," manager Bob Melvin said in announcing the change before the Diamondbacks played Cincinnati on Saturday.
Lyon (2-5, 5.23) has an 11.57 ERA since the All-Star break, allowing 21 runs in 16 1/3 innings.
He gave up two runs in the ninth in a 4-3 loss at San Francisco on Wednesday. He came on in relief in the ninth Friday night against Cincinnati with a 3-0 lead and gave up two runs before Qualls replaced him. With runners at first and third, Qualls struck out Jerry Hairston Jr. to preserve Brandon Webb's 20th victory of the season.
Lyon understood the move, Melvin said.
"All he wants to do is help the team win," the manager said. "In that respect, he took it like a pro."
Lyon has 26 saves in 31 opportunities this season.