A federal court invalidated the patent for a blockbuster osteoporosis drug made by Merck & Co. on Friday, sending Merck shares plunging but offering patients with the brittle-bone disease the possibility of cheaper pills in a few years.

The U.S. Court of Appeals for the Federal Circuit in Washington, D.C., invalidated the patent for the once-a-week version of Merck’s Fosamax, which dominates the market for osteoporosis drugs. Under the ruling, generic competition could begin as soon as early 2008, instead of 2018.