RALEIGH, N.C. — J.T. Miller scored twice in a 2:10 span of the second period, cracking open a close game as the Rangers dispatched the Hurricanes, 4-1, on Friday night and won two games in a row for the first time since Nov. 21-23.

Thirty seconds into the third period, the Rangers got a scare. Rick Nash crashed awkwardly into the boards and stayed down as trainer Jim Ramsay raced onto the ice and helped the winger, who was not putting weight on his left leg, to the dressing room. Nash returned halfway through the period, then went down again when Justin Faulk’s shot hit him in the left knee.

Friday night, the big gun was Miller, who is red hot — he has scored four of his 12 goals in the last four games and has eight goals and 12 points in his last 17 games.

After Miller’s goals, which came with the Blueshirts leading 2-1, the Rangers protected the three-goal lead in the final 20 minutes, including the killing of Dan Girardi’s high-sticking penalty at 10:50. They fell back on defense, with just one shot on Carolina goalie Eddie Lack in the third, and the Blueshirts, who led 2-0 after the first period, raised their road record to 9-11-3.

Henrik Lundqvist finished with 30 saves for his 22nd win. “We came out really focused,” Lundqvist said. “We set the tone in the first with a lot of good chances.”

Including the 3-2 defeat of Vancouver, Lundqvist said, “Back-to-back, these have been two of our better games. We looked like the team we were in October.”

advertisement | advertise on newsday

At the 1:12 mark of the second, Derek Stepan just missed pushing the Rangers to a 3-0 lead. He stripped the puck from defenseman Brett Pesce at the Blueshirt blue line, sailed in and hit the post. It was just one of the gaffes by a trio of young Canes defensemen.

At 3:29, the Canes cut the Rangers’ 2-0 lead in half. Dan Boyle, after being clipped in the mouth, held his face with his glove and couldn’t get back quickly into the play, allowing the open Joakim Nordstrom to score from the left circle.

Miller then scored his pair. His first, from the lower left circle, was a snapped shot over Lack off the crossbar and in at 9:41. Then he stripped Jaccob Slavin in the slot area in front of Lack, deked the Canes goaltender to the ice, and went forehand around him for the 4-1 lead.

“Our system is to have an aggressive forecheck and we did a good job, especially in the first 40 minutes,” Miller said.

On his second goal, Miller said: “I tried to sweep across, and he mishandled it a little bit, I rerouted him and went in and just made a nice move.”

After Lundqvist was tested several times in the first period, Rangers captain Ryan McDonagh opened the scoring by picking off a pass by John-Michael Liles in the neutral zone, skating to the left circle and firing a bullet past Lack at 14:01. McDonagh’s first goal since Dec. 17 gave him four points in the last four games.

Keith Yandle made it 2-0 when he raced in from the left point and redirected Oscar Lindberg’s pass from behind the goal line at 17:53.

For only the third time this season, two Blueshirts defensemen had scored in the same game. McDonagh and Dan Girardi scored Dec. 12 against St. Louis; Girardi and Kevin Klein tallied against Calgary on Oct. 25. The scores put the Canes in a hole — Carolina was 0-13-0 when trailing after the first period.

The Rangers, who have beaten the Hurricanes nine straight times, have two games remaining before the All-Star break: in Ottawa on Sunday and at home against the Sabres on Monday.