Thanks to a late third-period surge Sunday, the Bruins avoided a totally lost weekend.

They had fallen to a bad, injury-riddled Flyers team Saturday. Then, for two-plus periods in Buffalo, they were deadlocked in a 0-0 tie with another nonplayoff team.

The Bruins indeed have to do more hiking to get out of the woods where they’ve somehow meandered.

If there was a good sign to the weekend games, it was the revival of the David Krejci line. After helping the B’s off to such a strong start, Krejci’s wingers went stone cold. Milan Lucic went 15 games without a goal, and Nathan Horton had one goal in 14 games.

A spring thaw appears to be upon them. It started with Lucic breaking out for a goal on a nice rush against Toronto on March 25. Horton got back on the horse with a goal Wednesday against Montreal, and now has three in the last three games.

Against Philly on Saturday, the trio was the only bright spot in a bad loss to the Flyers. In Buffalo, they finally turned the game in the Bruins’ favor with tough work down low for goals by Krejci and Horton, who had a team-high six shots.

“I thought our line had a good game in Philadelphia and we wanted to keep it going in (the Buffalo) game,” said Lucic as the Bruins prepared to get right back at it tonight against the Ottawa Senators at the Garden. “I felt we were able, as a line, to put two pretty good games together and keep it going in this game here. We put two good games together and hopefully we can keep on building on what we’ve done.”

In the win at Buffalo, they were rewarded for simply keeping at it.

“We tried not to get frustrated like we have as of late when things haven’t been going for us,” said Lucic, who picked up an assist and saw a great scoring chance roll off his stick early in Sunday’s game. “We’ve gotten frustrated and let it get the better of us. But (Sunday), we tried to stay positive and stick with the game plan, stay patient, and it worked out for us.”

According to Krejci, his line has taken several steps forward.

“I think we had a solid game in Philly and we tried to be even better (Sunday),” said Krejci. “We had some pretty good scoring chances in the first two periods that we didn’t score on, but we stuck with it. We got two big goals from our line and we’re happy about that.”