The first batter in Friday night’s baseball game at Hadlock Field scorched a grounder that got by the third baseman and left fielder.

It would be that kind of night for the Portland Sea Dogs in a 9-4 loss to the Harrisburg Senators before a crowd of 6,597.

Portland closed out July with a 12-17 record and is 40-67 overall. To avoid the worst record in franchise history (59-83 in 2011), the Sea Dogs will have to win 20 of their last 35 games.

Harrisburg improved its record to 51-56.

Henry Ramos paced Portland with a 3-for-3 night with a walk, a double and an RBI single. Ramos, 23, an outfield prospect for the Red Sox, is coming back from a second straight injury-riddled season – a broken leg in 2014 and knee surgery early this year. Friday was only his 23rd game for the Sea Dogs this year. He upped his average to .233.

The Senators are last in the Eastern League in batting but enjoyed 14 hits Friday, including a three-hit, four-RBI night by designated hitter Chris Bostick. He hit a home run, a double and a single.

Bostick, 22, was a 44th-round draft pick of the Oakland A’s in 2011 and has since been traded twice, to the Rangers, then the Nationals.

“To be traded so many times says there’s a lot to like,” said Harrisburg Manager Brian Daubach, the former Boston Red Sox first baseman who knows a little about working his way up. He toiled nine years in the minors before reaching the majors.

Bostick is batting .236 in 41 games.

“He’s a young kid and we’ve challenged him a little by bringing him to Double-A,” Daubach said. “He’s just settling in. He’s done a lot of work in the cage and it all came together for him tonight.”

While Bostick is a relative unknown, Harrisburg starter Matt Purke is not. A third-round draft pick in 2011, Purke commanded a $4 million major league contract. But shoulder trouble, then Tommy John surgery last year, have held him back.

Purke (1-1) got the win, allowing two runs over five innings.

Sea Dogs starter Justin Haley (4-12) took the loss, also going five innings: seven hits, four runs (three earned).

Haley left with the Sea Dogs down 4-2, but the Senators got three runs off Kyle Martin in the seventh.

Jorge Marban relieved in the eighth. He pitched a 1-2-3 frame – extending his scoreless streak to 19 innings – but then gave up two runs in the ninth.

Cutter Dykstra and Shawn Pleffner also had three hits apiece for the Senators.

Manuel Margot, Carlos Asuaje and Tzu-Wei Lin each drove in a run for the Sea Dogs.

NOTES: With Red Sox catcher Sandy Leon designated and then placed on Triple-A Pawtucket’s roster, catcher Luis Martinez came back down to the Sea Dogs. To make room for him, first baseman David Chester was placed on the disabled list. … Saturday will feature fireworks after the game. … Before Sunday’s game, ticket-holders can play catch in the Hadlock outfield from 10 to 11:15 a.m.