Just a few years ago, the future looked uncertain for Biogen Idec Inc..

Some thought its most profitable drug, Avonex, would gradually become obsolete as rivals developed their own products to treat multiple sclerosis. Its newer MS drug, Tysabri, was dogged by safety questions. And activist investor Carl Icahn was pushing hard for the company to be broken up or sold after years of unimpressive stock performance.

But Biogen Idec surprised many investors. Avonex sales continued to rise, approaching nearly $3 billion last year. Tysabri has become a blockbuster in its own right with more than $1 billion in annual sales.

And this year, Weston-based Biogen Idec won approval for another potential billion-dollar drug — a pill for MS patients, instead of the injections it has traditionally sold — with several more promising products in the pipeline.

Since George Scangos became chief executive three years ago, the company’s stock market value has quadrupled to $50 billion — jousting with EMC for the claim to be the Bay State’s most valuable publicly traded company. And both Biogen Idec’s revenues and profits have risen for four straight years. Last year alone, it earned $1.4 billion in profits on $5.5 billion in revenue.

“We had a lot of good luck, and we did some good things,” Scangos said.

Biogen Idec, one of world’s oldest biotechs, has a history of resiliency in an industry where failures and mergers are common. It’s been a fixture on the Globe 100, appearing 18 times over the past quarter-century, more than any other biotechnology company that remains independent today. Biogen Idec earned a spot as the number eight company on this year’s list.

The company’s more recent performance has been aided by a series of decisions Scangos made once he became chief executive.

He streamlined operations — shutting down the company’s longtime San Diego outpost (where Idec was based prior to its merger with Biogen). He also closed its oncology and cardiovascular research areas to focus on its traditional core strengths, such as multiple sclerosis.

“We were spread too thin,” Scangos said, noting the company had many drugs in development that were not progressing. “Nothing was adequately resourced.”

He also decided the company headquarters should return to Cambridge, the heart of the biotech center in the region, reversing the pervious chief executive's decision to move to less expensive office space in suburban Weston.

But now, Scangos said, the company is back on track.

In March, the Food and Drug Administration approved Biogen Idec’s application to sell Tecfidera, the company’s first pill for MS and a likely blockbuster drug.

Suzanne Kreiter/Globe staff

Kurt Van Vloten works in the Cambridge lab.

The investment banking firm Leerink Swann predicted Tecfidera could generate sales of $1 billion next year if the drug also wins European approval, and $4 billion worldwide by 2018.

Leerink also said Biogen Idec already has nearly one-third of the market for MS drugs. But the approval of Tecfidera, coupled with other products in the pipeline, is likely to help Biogen Idec expand its “market dominance” in the area, Leerink said in a note to investors.

Biogen Idec hopes to have three more drugs approved over the next 18 months, including two for hemophilia, a genetic condition that interferes with the body’s natural ability to stop bleeding.

But nothing is certain in biotech. Many promising compounds in the lab turn out to have unexpected side effects or prove to be ineffective in broader clinical trials. In January, the company reported that a widely anticipated drug to treat Lou Gehrig’s disease, a devastating disease also known as ALS, flopped in a late-stage trial — breaking the hearts of patients and investors alike.

“We are going to have some failures,” Scangos said. “If we don’t have some failures along the way, we are not being imaginative enough.”

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.