December 20, 2012: 11:13 AM ET; from CNN Money
By Omar Akhtar, reporter

Companies use a variety of methods to stay one step ahead of their rivals. Competitive intelligence is one of the fastest growing ways to pull this off.

FORTUNE — Corporate espionage may be illegal, but companies can still keep tabs on the competition. Some large corporations around the globe spend more than $2 million a year hiring outside firms or staffing internal departments to track and analyze the actions and strategies of their competitors. These companies pull this off with the help of public resources and investigative research, a practice collectively known as competitive intelligence (CI).

“Competitive intelligence is gathering information, which is analyzed to the point where you can make a decision,” says Leonard Fuld, president of competitive intelligence and research firm Fuld & Company. This includes gathering information about competitor’s products, pricing, business culture, and investments, as well as external factors like market conditions and government regulations.

More than anything, CI aims to eliminate surprises. “Companies seem to have been caught off guard more by new and disruptive technologies in the last five years,” says Jan Herring, former director of intelligence at Motorola. “As a result, senior management has become more appreciative of gathering intelligence and we’re seeing expanded areas of application.”

Herring, a former CIA officer, was asked to bring his government intelligence experience to Motorola in the mid-80s. “I believed that, much like governments, multi-national companies were going to need their own intelligence departments to be able to make the right decisions,” says Herring.

In many ways, competitive intelligence is as old as business itself. In the late 1800s, the Rothschild family sent its bankers to France to observe banking techniques and adopt the best strategies. However, Herring says the modern incarnation of competitive intelligence took root in the 1980s, pointing to the publication of Harvard Business School professor Michael Porter’s Competitive Strategy: Techniques for Analyzing Industries and Competitors. “It was the seminal document that caused everybody to focus on intelligence gathering as a profession,” says Herring.

Basil Rathbone as Sherlock Holmes

Recession-proof business service?

While businesses have been slashing budgets in the wake of the recession, expenditure on intelligence has actually edged up. A survey of 400 global companies by Fuld & Company reports that in the last five years the number of companies that spend more than $1 million on CI has increased from 5% to 10% of all companies with CI programs.

The pharmaceutical industry accounts for 27% of companies that spend more than $2 million on competitive intelligence, far more than any other sector. “Pharmaceutical companies are probably the best at doing what we do now,” says Herring. “Plus there is a lot of public information out there they can utilize.” Predictably, the financial services world has seen the largest decrease in spending while technology is the fastest growing sector for CI programs in the last five years.

Pharmaceutical companies (and the outside firms they hire) perform competitive intelligence in a variety of ways. CI practitioners like Fuld attend scientific conferences, often hosted by drug companies looking to generate buzz for their latest product. They keep their eyes and ears open for gossip, insider information, and questions asked by attendees that might lead to a better understanding of what’s actually going on in a given industry.

“A lot of times, companies will hire us when one of their drugs is about to be approved for the market and they want to know how the competition will respond,” says Fuld. Other points of interest include results from clinical trials, articles in medical journals, and “messaging,” the words and rationale companies use to market a drug. Fuld will keep a close watch for news about mergers and acquisitions, government regulations, and anything else that could affect his clients’ prospects.

Another strategy is to monitor online voices, especially on blogs and social media. Fuld says Twitter is a great place to glean information about customers’ thoughts on a product and how the competition responds to them. “Patients will talk about their experiences, their illnesses, and their needs,” says Fuld. “They’ll be the ones who bring the drug to market.” Companies also use social media channels to send out alerts for their activities, such as notices for participation in clinical trials.