Lee Martin was a search consultant who found job candidates for companies in commercial construction and real estate. But the recession sapped 2.2 million jobs out of construction, forcing the Dallas recruiter to refocus his niche or look for another job.

After doing research and connecting with his network to get introductions and references, Mr. Martin began to aggressively pursue government building contracts. It was a smaller and more specialized market but there was a wartime construction boom of military bases and infrastructure that helped to carry Mr. Martin's recruiting firm through a few tough years. Mr. Martin is now a managing partner at his recruiting firm.

In whatever field you work in, specializing is one tactic that can be used to improve your odds of surviving layoffs if you can correctly anticipate future company and industry needs, say career experts.

Specialization also pays better and is a more attractive pitch to those employers that are cautiously hiring again and looking for specialized candidates to fill new growth areas or restore old ones.

"It sounds counterintuitive but the specialist tends to be the higher-valued employee because of their specific competency and because they have broad training that allows them to back out and take on more general roles as needed," says Jeff Kaye, co-chief executive of Kaye/Bassman International, a Dallas-based recruiting firm. "And when things improve, the specialist can return to the work that they were originally hired to do. It's not the same for the generalist who may require additional training."

Taking on a specialty or a subspecialty can also be a way to reinforce your value to the company. Andrew Kratky weathered several big layoffs at a Chicago manufacturing firm by volunteering for unpopular assignments-including an extended stint in Brazil. He also made some lateral moves out of staff-reduced departments and worked with a mentor, which led to a deeper understanding of finance, operation and business development.

"Now, when I deal with companies, I can really understand what drives their business," says Mr. Kratky, who is now director of procurement. "A lot of procurement people don't understand this and don't have a real appreciation for it, but it helps significantly when negotiating."

Avoid being caught in a dwindling niche like offset print stripping. It's important to closely monitor your industry through trade publications, industry networking and analyst commentary, since most career niches won't disappear overnight. They'll evolve in predictable ways that you can adapt to. But once you make a decision, you must act quickly. Many travel agents, for example, have narrowed their focus to serve corporate clients or offer specialties like adventure travel.

In many cases, it's up to you to pursue additional training, certifications and experience since so many companies still have slashed training budgets and no plans to restore them, says Tim Honn, founder of Fortis Recruiting Solutions in Lisle, Ill. "For college students who are having a hard time finding a job, that may mean getting a masters or Ph.D. so you can do research for companies and become more specialized in your field. You need to bring something that differentiates you from everybody else to the table."