As the recession dragged on and on last year, the 10 states of the Northeast hardly escaped unscathed. Collectively, however, they were a bright area in an otherwise dim national landscape.

The reasons vary as much as do the states themselves along the Atlantic Coast northward from Maryland to Maine. Generally, the key was diversity, with more defense spending, numerous high-technology industries, a concentration of finance, insurance and real estate jobs, and even casinos all helping the region economically.

None of the states in the region had an unemployment rate in November higher than 9.5 percent even though the national average was 10.4 percent on the same not-seasonally-adjusted basis. Massachusetts' rate was only 6.5 percent and Vermont's 6.7 percent.

Furthermore, only five metropolitan areas of the 40 in the region had unemployment rates higher than that 10.4 percent national average, according to October figures, the latest available. Stamford, Conn., with a 3.8 percent rate, had the lowest figure in the country.

Some recent snapshots around the region include the following:

On the frigid banks of the Kennebec River in Maine, the Bath Iron Works has added about 1,500 jobs in the last year, for a total of 8,500, to keep its contracts for building Navy frigates and two commercial oil tankers on schedule. Ship repair work is expanding, and another 1,000 or so jobs will be added as a new facility in Portland is completed with aid from both city and state governments.

In New Jersey, Atlantic City is booming. And state officials estimate that the expanding casinos there have produced about 35,000 jobs for the state, with more on the way. "Potentially, it's one of the most vibrant cities in the United States," says New Jersey Treasurer Kenneth Biederman.

New York City's growth of employment in banking, financial services and other white-collar occupations, while slowing, has offset steady declines in manufacturing. Many of the jobs, however, have gone to suburban commuters rather than city residents.

The region's recent record is all the more remarkable for the fact that in eight of the 10 states a larger share of the work force is in manufacturing than is the case nationally. By far the biggest layoffs have come in manufacturing across the nation, and that is also true in the Northeast. Massachusetts managed its remarkably low unemployment rate despite having one-fourth of its workers in manufacturing.

The proportion of manufacturing employes laid off has been smaller in this region than elsewhere because of the industries involved. For example, production of electronic-based equipment, in which New York and Massachusetts trail only California and Texas, has fallen hardly at all compared to the disasters in autos, steel and other heavy industry.

The region, nevertheless, has some spots that are hurting. New York state, with nearly 8 million of the more than 20 million workers in the region, is not just Manhattan. It also has industrial centers that are as badly off as many of the hard-hit cities of the industrial North Central states.

Unemployment in the Buffalo area, for instance, had jumped by 6 percentage points in the last year and was already close to 14 percent before last month's devasting announcement by Bethlehem Steel that it will close its huge Lackawanna, N.Y., plant--ending as many as 7,000 jobs. Bethlehem also has laid off 3,000 workers at its Sparrows Point plant outside Baltimore in the last year.

And slow sales of General Motors' J cars caused that company to close its assembly plant in Framingham, Mass., in September, idling about 3,400 workers and shutting off an annual flow of more than $100 million into the Massachusetts economy. Farther south at another plant in Newark, Del., GM has also had large layoffs in the last year.

As the recession continued and businesses began cutting back on major investment projects, even the high-tech companies began feeling a pinch. In the first nine months of 1982, employment by such companies in Massachusetts fell by 13,300, for example.

Some companies and industries in the region that formerly were almost immune to layoffs have had to turn to them. Rochester-based Eastman Kodak Co., one of the larger employers in New York state, recently announced a series of incentives designed to encourage early retirement that the company hopes will allow it to avoid layoffs.

Layoffs already are happening at some large property-casualty insurance companies in Connecticut and New York because of large underwriting losses and a need to cut overhead.

In short, the Northeast has not escaped the ravages of recession. But the region's economic diversity and its sharp move away from a dependence on durable goods, shoes and textiles over the last two decades has left it substantially better off than most parts of the country.

At the same time, there is sufficient emphasis on production of investment goods that the region might do slightly less well in coming months than the national averages as the recovery expected this year gathers momentum, according to several economists who follow state-by-state developments.

The recovery is expected to be led by consumer spending and residential construction, notes Fred Breimyer, vice president and economist at the First National Bank of Boston. "A moderate-paced national recovery would be reflected in a slightly less fast-paced recovery for Massachusetts," he says.

"Presumably, recovery nationally would depend on accelerated purchases of consumption goods and on residential construction. Each sector is underrepresented in the Massachusetts economy.

"Conversely, capital spending is widely forecast to be exceptionally weak in 1983. That weakness will be reflected in the state's high technology industries, as they are closely tied to business spending," Breimyer concludes.

An upturn in housing construction, which seems clearly underway already, should give a boost to the depressed forest products industries across the three northern New England states.

In Rhode Island, Mary McGoldrick, an economist with the Rhode Island Hospital Trust National Bank, expects a similar pattern to develop. As the national recovery proceeds, she thinks there will be a strong rebound in the jewelry, textile and other nondurable manufacturing industries first, with the metalworking and machinery industries coming back more slowly.

In addition, the increase in defense spending will give the entire region a boost over the next few years. Data Resources Inc., a Massachusetts-based economic consulting firm, estimates that direct defense spending will go up 15 percent in Connecticut and 14 percent in Vermont between 1982 and 1984. In Maine, Maryland and New Hampshire, the gains all will be above 10 percent.

Here and there, of course, one might never know there was a recession. Jack MacDiarmid, president of the Chamber of Commerce of the Greater Portland Region, fairly bubbles with enthusiasm over what is happening there. "We have such a diverse economy that we wind up not suffering like the rest of the country."

The loss of up to 1,000 jobs at a General Electric factory making heat exchangers for nuclear-powered electric generating plants will be offset by the new Bath Iron Works repair facility. Meanwhile, the Union Mutual Life Insurance Co., the Maine Medical Center and a Fairchild Corp. semiconductor plant are expanding, a new fish processing pier is on the way, and an older part of the city near the waterfront is being renovated.

In South Portland, Bernie Regan, manager of a Woolworth store and head of the merchants association at the Maine Mall, is just as enthusiastic. The mall is expanding with three new large department stories coming in along with about 60 smaller stores. "The expansion should mean an additional $80 million in sales," Regan says.

Just up the road in Freeport, L.L. Bean Inc., the venerable mail-order house, shrugged off any hint of recession last year, staying right on track with its plan of increasing sales at "a steady 25 percent a year," says spokesman Kilton Andrew.