The 2012 Red Sox season mercifully comes to an end Wednesday night in New York. The members of this historically bad unit will disperse, and the rebuilding will begin immediately.

Historically bad? Yes. This was the first 90-loss Red Sox season since 1966, and just the fourth 90-loss season for Boston in the past 80 years.

The team will move quickly to assess the managerial situation. It would be stunning if Bobby Valentine is retained for another season, but there’s always a chance team ownership decides it was the players, and not the manager, who were to blame for this epic collapse.

The Sox were swept in Baltimore over the weekend as the Orioles clinched their first postseason berth since 1997. The O’s are a pretty good model for the Red Sox to follow in the months ahead. Last season, Baltimore lost 93 games and finished last in the AL East. A year later they were fighting for the division title.

Baltimore was able to build around a nucleus of players like Adam Jones, Nick Markakis, Mark Reynolds and Chris Davis. They didn’t need to make any blockbuster trades in the offseason, but complemented the existing roster with pitching depth and role players.

Hard as it may be to believe, the Red Sox have a core to build on for next season. Dustin Pedroia is the team’s leader. Will Middlebrooks should have a breakout season if healthy. The catching tandem of Ryan Lavarnway and Jarrod Saltalamacchia is dependable enough, and should improve under the mentoring of Jason Varitek, the newly named assistant to the general manager.

The Sox should re-sign David Ortiz and Cody Ross, who would combine with Pedroia and Middlebrooks to form a decent middle of the order. If Jacoby Ellsbury is back in center (even for one final year) the top five spots in the lineup look good.

There are gaping holes, to be sure. They have no first baseman and need at least one more starting outfielder. GM Ben Cherington will have to at least consider trading Ellsbury if it doesn’t seem the center fielder will sign an extension to stay. They have to make a decision at shortstop, either using Mike Aviles for another season or going for the defensive impact of 22-year-old Jose Iglesias.

The top of the rotation seems set with Clay Buchholz, Jon Lester, John Lackey and Felix Doubront. Buchholz and Lester both rebounded after rough starts, and Lackey will need to prove himself after Tommy John surgery. Those are significant if’s, but three of the four have a history of big-league success and need to show they can still get the job done.

Andrew Bailey, Mark Melancon, Junichi Tazawa and Clayton Mortensen make up a good young core of relievers. Cherington should be able to build a bullpen around them.

This may be overly optimistic, but with a couple of key moves the Red Sox should be a team battling for at least a wild-card spot next season. The franchise has money to spend after the Dodger bailout of August, and with a couple of shrewd trades this team could make the same kind of improvement the Orioles have made in the last 12 months.

Tom Caron is the studio host for Red Sox broadcasts on the New England Sports Network. His column appears in the Press Herald on Tuesdays.