The Nets kept making runs in the second half last night. But every time they did, the Rockets had an answer.

More to the point, they had James Harden.

Harden scored 15 of his 22 points in the second half to help the Rockets hold off several Nets rallies down the stretch and emerge with a 106-96 victory in front of a sellout crowd of 17,732 at Barclays Center.

“We made a few runs, and just didn’t get over the hump,” said Brook Lopez, who finished with 27 points and looked like an All-Star for the first time since coming back from All-Star weekend in Houston. “We were right there.”

With Joe Johnson sidelined for the first time this season with plantar fasciaitis in his left foot, the Nets were without their closer. But as Johnson sat on the bench, he watched his teammates make a spirited run in the fourth quarter — after falling behind by 15 — to cut the deficit to three at 97-94 with 2:57 left on a Mirza Teletovic 3-pointer.

But without Johnson to bail out the Nets, it was the Rockets who made all of the big plays down the stretch. Carlos Delfino, who also scored 22 points for Houston, drained a 3-pointer and a long two on back-to-back possessions. Harden then officially ended the game with his 3-pointer over the outstretched arm of Keith Bogans with 39.8 seconds left that put the Rockets up 105-96, gave Houston its 13th consecutive victory over the Nets and sent the capacity crowd heading to the exits.