Biogen shares were on track to post one of their worst days in history on Friday, after the biotech giant lowered its forecast for 2015 on slower-than-anticipated growth of its multiple sclerosis blockbuster Tecfidera.

The Cambridge, Massachusetts-based company said total sales will grow 6 to 8 percent this year, down from a previous prediction of 14 to 16 percent. Earnings per share, adjusted for some items, are expected to range from $15.50 to $15.95, down from $16.60 to $17 that Biogen predicted earlier this year.

"Biogen's 2Q report is a messy one to say the least," JPMorgan analyst Cory Kasimov wrote in a research note. The shares were down 21 percent Friday afternoon.

So what happened?

Doctors may be spooked about a safety issue with Tecfidera, Biogen said on its earnings call Friday. The concern is about a rare brain infection called PML, for progressive multifocal leukoencephalopathy, which emerged among patients taking an older Biogen drug, Tysabri.

Suzanne Kreiter | The Boston Globe | Getty Images

A Biogen Idec lab technician

Biogen, which in October reported the case of PML in a patient taking Tecfidera, said Friday the event has created greater caution for doctors in switching patients to oral therapies. A second case of PML has been reported since.

"Our U.S. market research indicates a moderation in physician intent to prescribe, though in Q2 Tecfidera continued to gain patients in the U.S.," Biogen chief commercial officer Tony Kingsley said on the call.

Analysts note the incidence is still extremely rare; Kasimov noted earlier this month only two cases have been seen amid more than 155,000 patients treated with the drug. Biogen reported Tecfidera sales of $883 million for the second quarter, up 26 percent from the same period in 2014.

"We're very disappointed in the change of outlook for the year," Chief Financial Officer Paul Clancy said on the call. "We're working tirelessly to turn our commercial performance around and will aggressively look for opportunities to reduce expenses while simultaneously assuring we invest in the pipeline."

UPDATE: This story has been updated to reflect Biogen's stock price as of the afternoon.