<PAGE>

                                                                 Exhibit 10.5(b)

                                                                  EXECUTION COPY

                                 AMENDMENT NO. 1
                                       TO
                              AMENDED AND RESTATED
                             MANAGED CARE AGREEMENT

     Amendment No. 1, dated as of July 23, 2003 ("Amendment No. 1") to the
Amended and Restated Managed Care Agreement between Merck & Co., Inc., a New
Jersey corporation ("Merck"), and Medco Health Solutions, Inc., a Delaware
corporation ("Medco"), dated as of May 28, 2003 (the "Agreement"). Capitalized
terms used but not defined herein shall have the meanings ascribed to them in
the Agreement. All section references used herein are to the Agreement.

     WHEREAS, Medco, an independently managed wholly-owned subsidiary of Merck,
is in the business of providing PBM Services to corporations, health maintenance
organizations, unions, insurance carriers, government employee plans and others;

     WHEREAS, Merck is a pharmaceutical company engaged in the discovery,
development, manufacturing and marketing of pharmaceutical products;

     WHEREAS, the parties desire to amend the Agreement to clarify the terms
upon which Medco would be entitled to receive market share rebates from Merck
for the utilization, from and after the Effective Date, of Merck Products by
Medco Plans; and

     WHEREAS, this Amendment No. 1 shall be deemed to be effective as of the
Effective Date.

     NOW, THEREFORE, in consideration of the foregoing, the parties hereby agree
as follows:

          1. The definition of "Target MAS Premium Percentage" as set forth in
Annex B of the Agreement is hereby amended to read in its entirety as follows:

          "Target MAS Premium Percentage" shall be, with respect to the Calendar
     Quarter ended December 31, 2001, the sum of all of the Weighted Medco
     Market Share Premium Percentages for the Calendar Quarter ended December
     31, 2001, excluding from such calculation Prinivil(R)/Prinzide(R) and the
     Therapeutic Category that includes Prinivil(R)/Prinzide(R), and utilizing a
     Weighted Medco Market Share Premium Percentage for Zocor(R) that is
     calculated assuming a Medco Market Share for Zocor(R) for the Calendar
     Quarter ended December 31, 2001 that is equal to the actual Medco Market
     Share for Zocor(R) for the Calendar Quarter ended December 31, 2001 less
     the Zocor(R) Permitted Percentage Point Reduction set forth on Schedule 4
     to this Annex B. Medco shall deliver to Merck

<PAGE>

     within 30 days from the Effective Date the Quarterly Data with respect to
     the Calendar Quarter ended December 31, 2001. Within 30 days after receipt
     of complete and accurate Quarterly Data for the Calendar Quarter ended
     December 31, 2001, Merck shall calculate the initial Target MAS Premium
     Percentage referred to in the first sentence of this definition. With
     respect to each given Calendar Quarter beginning with the Calendar Quarter
     ended March 31, 2002, the "Target MAS Premium Percentage" shall be
     adjusted, if necessary, to be equal to the sum of (x) the Target MAS
     Premium Percentage for the immediately preceding Calendar Quarter, (y) the
     Outgoing Medco Plans Adjustment Percentage for such given Calendar Quarter
     and (z) the Incoming Medco Plans Adjustment Percentage for such given
     Calendar Quarter. (It is understood that Schedules 1 and 3 to this Annex B
     operate to adjust each of the percentages set forth under "Rebate Tiers" in
     Schedule 3 to this Annex B and under "MAS Premium Percentage" in Schedule 1
     to this Annex B simultaneously with any adjustments to the Target MAS
     Premium Percentage in accordance with the foregoing.) If, at the end of any
     Calendar Quarter ending after the Effective Date, the Cumulative Incoming
     Sales Adjustment Amount exceeds 20% of the sum of the Aggregate Medco Cost
     of all Eligible Prescriptions of all Merck Products dispensed during the
     Calendar Quarter ended December 31, 2001 under all Eligible Medco Plans,
     Merck shall have the right, at any time thereafter, to renegotiate with
     Medco the adjustment methodology reflected above in this paragraph.
     Notwithstanding the foregoing, with respect to Calendar Quarters after the
     Final Zocor(R) Calendar Quarter, (a) the Target MAS Premium Percentage for
     such Calendar Quarter shall be equal to the "Target (Ex-Zocor(R)) MAS
     Premium Percentage (as calculated in accordance with the definition
     thereof) and (b) the percentages under "Rebate Tiers" in Schedule 3 to this
     Annex B and under "MAS Premium Percentage" in Schedule 1 to this Annex B
     shall be adjusted so that the increment (expressed as a percentage) between
     each consecutive tier shall be equal to the increment between such tiers as
     of the execution date of this Restated Agreement (one percent) multiplied
     by the Ex-Zocor(R) Reduction Factor (rounded to the nearest hundredth
     decimal place). (It is understood that, after such adjustment to those
     increments, Schedules 1 and 3 to this Annex B will operate to adjust each
     of the percentages set forth under "Rebate Tiers" in Schedule 3 to this
     Annex B and under "MAS Premium Percentage" in Schedule 1 to this Annex B
     simultaneously with any adjustments to the Target (Ex-Zocor(R)) MAS Premium
     Percentage in accordance with the foregoing.)

          2. The parties agree and acknowledge that, notwithstanding anything to
     the contrary contained in the Restated Agreement, in the event that, for
     any Calendar Quarter, Medco is not entitled to receive a Formulary Access
     Rebate Amount in respect of Eligible Prescriptions of a Merck Product
     dispensed during such Calendar Quarter under a Medco Plan for any reason,
     Medco shall also not be entitled to receive any MAS Rebate in respect of
     such Eligible Prescriptions of

                                       2

<PAGE>

     such Merck Product dispensed during such Calendar Quarter under such Medco
     Plan.

          3. All references in the Agreement to "the Restated Agreement" are
references to the Agreement as amended by this Amendment No. 1. The definition
of Restated Agreement in the Agreement is hereby amended to read in its entirety
as follows:

          "Restated Agreement" means this Amended and Restated Managed Care
     Agreement, dated and executed on May 28, 2003, between Merck and Medco, as
     further amended by Amendment No. 1 dated as of July 23, 2003, and effective
     as of the Effective Date.

          4. This Amendment No. 1 may be executed simultaneously in two or more
counterparts, each of which shall be deemed an original, but all of which
together shall constitute one and the same instrument.

                                       3

<PAGE>

         IN WITNESS WHEREOF, the parties have executed this Amendment No. 1 to
the Agreement as of the date set forth above.

                                             MERCK & CO., INC.


                                             By:    /s/ Margaret G. McGlynn
                                                 ----------------------------
                                             Name:  Margaret G. McGlynn
                                             Title: President, U.S. Human
                                                    Health Division

                                             MEDCO HEALTH SOLUTIONS, INC.


                                             By:    /s/ David B. Snow, Jr.
                                                 -------------------------
                                             Name:  David B. Snow, Jr.
                                             Title: President and Chief
                                                    Executive Officer