Miller and three relievers combined on a three-hitter, and Oscar Taveras hit a two-run homer for the St. Louis Cardinals, who beat the San Diego Padres 6-2 Thursday to avoid a three-game series sweep.
The victory came hours after the Cardinals traded Kelly and Allen Craig to Boston for right-hander John Lackey.
Miller teared up afterward while talking about Kelly.
"That's a tough one for all of us, to lose two guys like that, especially Joe for me," Miller said. "I grew up with him and came up through the farm system with him. He's going to do well there. I wish him all the best."
Miller (8-8) held San Diego to two runs and three hits in six innings. He struck out five and walked none in his first win since June 7.
St. Louis roughed up rookie Odrisamer Despaigne a day after playing what manager Mike Matheny called the team's ugliest loss of the season, a 12-1 defeat Wednesday night.
"They're pros," Matheny said. "I mean, things are going to happen in our lives that we've just got to be able to compartmentalize. These days here I think prove the toughness that these guys develop through the season. You have to put it aside and get the job done."
Taveras connected with two out in the second, sending a drive to right for his second homer. But St. Louis' 2-0 quickly evaporated.
Jedd Gyorko, on a tear since returning Monday from a 44-day stay on the disabled list, homered to right off Miller with one out in the bottom half. It was Gyorko's second in two games and seventh overall. Will Venable homered to right with two outs, his fifth.
"There were a couple of solo homers there that got him on the edge a little bit, and then he stepped in and started making some really nice pitches," Matheny said. "I saw him driving the ball down through the bottom of the zone. He pitched a little more."
Said Venable: "I didn't see a pitch from him other than a fastball and it was a good one. He just pitched well. When you are aggressive with your fastball you have the option of going to your off-speed stuff. It wasn't like we were beating him on his fastball. We hit a couple of them but he was doing what he wanted really."
St. Louis jumped in front again on Matt Holliday's two-run single in the third, and Peter Bourjos added an RBI single in the sixth.
Despaigne (2-3) allowed six runs and nine hits in 5 2-3 innings. He won his first two starts but is 0-3 in his last five outings.
Cardinals: St. Louis got Lackey in exchange for Kelly and Craig. Lackey's first start with the Cardinals will come during a series against his former Red Sox teammates in St. Louis from Tuesday through Thursday.
Padres: Outfielder Chris Denorfia was traded to Seattle for outfielder Abraham Almonte, who will report to San Diego on Friday, and right-hander Stephen Kohlscheen, who will report to Triple-A El Paso. Almonte was Seattle's opening-day starter in center.
Padres: Catcher Yasmani Grandal was scratched because of some fluid that built up in his right knee, which was surgically repaired last year after a collision at the plate.
"When he squatted in the bullpen, it shifted to the back of the knee and it sort of buckled him a bit," manager Bud Black said. "He was in quite a bit of pain squatting."
Black said Grandal should be fine to catch Friday night against Atlanta.
Cardinals: Adam Wainwright (13-5, 1.92 ERA) gets the ball in the opener of an important home series against NL Central-leading Milwaukee on Friday night. Wainwright Is 10-6 with 2.19 ERA in 27 career games against the Brewers.
Padres: Eric Stults (3-13, 5.22 ERA) pitches in the opener of a weekend set against Atlanta. The left-hander has won only once in last 13 starts.
Gyorko is 7 for 14 in five games since being reinstated from the DL, including two homers, a double and six RBIs. He has 30 career homers, tying him with Mark Loretta for the franchise record by a second baseman.
Link to box score: St. Louis (57-50) 6 at San Diego (48-60) 2
Join the pre-game, in-game and post-game discussion about each contest at The Cardinal Nation message board.