For the last year, Pfizer has been laying the groundwork to combat the looming competition against Lipitor, forging deals with insurers, pharmacy benefit managers and patients to meet or beat the price of its generic replacements.

As it loses its patent for Lipitor, the top-selling cholesterol drug, on Wednesday, Pfizer is completing relationships and shoring up discounts — like a reduced co-payment of $4 a month versus the $10 customers would pay for many generic prescriptions.

Some deals require pharmacies to reject prescriptions for low-cost generics, starting Thursday, and substitute a discounted name-brand Lipitor. Some deals have blocked generic makers from mail-order services that account for an estimated 40 percent of all Lipitor prescriptions.

The company’s aggressive strategy may offer lessons for drug makers facing similar losses of patent protection for other blockbuster drugs over the next few years, and may chart a new path for shifts between the big pharmaceutical companies and generic rivals.