Roope Hintz scored, Joe Pavelski had an assist in his Dallas debut, and Ben Bishop made 18 saves.
Stars defenseman Roman Polak was injured when he hit the boards awkwardly at 7:04 of the second period while attempting to check Bruins forward Chris Wagner. He left the ice on a stretcher and was taken to a hospital for evaluation.
"The good news is that Roman has full use of his extremities," Stars coach Jim Montgomery said. "We hear he's feeling pretty good at the hospital, but we don't have results yet. We're hopeful that he may be a player again in a couple of days."
Forward Blake Comeau was hit in the face with a puck in the first period, and forward Jason Dickinson (upper body) did not return for the second period for the Stars. Comeau is expected to be out multiple weeks with a lower-body injury sustained when he fell awkwardly to the ice, and Dickinson will be out at least one week, Montgomery said.
"It's life in the NHL," Montgomery said. "Next man up. We went through it all of last year and we're a resilient group. We're a deep organization and we're going to be OK."
Ritchie gave the Bruins a 1-0 lead with a wrist shot at 1:09 of the first period.
"It felt like a playoff game," Ritchie said. "It was a little bit more exciting than your average [Thursday] night."
Heinen scored on the power play from the left face-off circle with Bishop screened to make it 2-0 at 5:59. The goal came on Boston's second shot.
"It's a game you would like to have being the first one at home and the fans were great," Bishop said. "It's unfortunate and was kind of a bad start by myself. I thought we did a good job trying to come back there."
Hintz made it 2-1 with a wrist shot at 7:55 of the second period. The goal came 51 seconds after Polak's injury.
"You just keep going," Pavelski said. "It was a good effort from the guys. We did a lot of good things. We can build off some, just got to find an extra goal out there and everything's all right."