<PAGE>

                                                                   Exhibit 10.40
                             AMENDED AND RESTATED
                        DEFERRED COMPENSATION AGREEMENT
                        -------------------------------



          THIS AGREEMENT is made this 1/st/ day of January 1, 2000, by and
between SELECT MEDICAL CORPORATION, a Delaware corporation ("Employer"), having
an address at P.O. Box 2034, 4716 Old Gettysburg Road, Mechanicsburg, PA 17055,
and ROCCO A. ORTENZIO, an individual ("Executive"), having an address at 7
Westwind Drive, Lemoyne, PA 17043.

          The parties hereto, intending to be legally bound hereby, agree as
follows:

          1.   Deferrals. For the period beginning on March 1, 1997 (the "Start
               ---------
Date") and ending on December 31, 2000 (the "End Date"), Executive agrees to
defer payment of his compensation (including base salary and bonus payments, if
any) to him in accordance with the terms and conditions of this Agreement. In
consideration of Executive's agreement to defer payment of such compensation,
Employer will establish on its books a deferred compensation account for
Executive (the "Account"), and will credit to the Account one hundred percent
(100%) of the compensation (including base salary and bonus payments, if any)
that would otherwise be payable to Executive under the Senior Management
Agreement between Employer and Executive, dated February 7, 1997, or any
successor agreement governing Executive's employment by the Employer as its
chief Executive Officer. Such amounts shall be credited to the Account as of the
date they would otherwise have been payment to Executive.

          2.   Agreement Unfunded. This Agreement shall be unfunded for tax
               ------------------
purposes and for the purposes of Title I of the Employee Retirement Income
Security Act of 1974, as amended. Executive shall have the status of a general
unsecured creditor of Employer and this Agreement shall constitute a mere
promise by Employer to make payments in the future. Employer may establish a
grantor trust to which general corporate assets may be contributed in order to
assist Employer in meeting its obligation under this Plan.

          3.   Interest on Deferred Amounts. For the period beginning on the
               ----------------------------
Start Date and ending on the December 31, 999, any amounts credited to the
Account pursuant to Paragraph 1 above shall accrue interest at the rate of six
percent (6%) per year compounded annually, from the date such amounts are
credited to the Account until December 31, 1999. Thereafter, no interest shall
accrue or be credited or paid with respect to any deferred compensation or the
Account.

          4.   Payment. The amount credited to the Account shall be paid to
               -------
Executive's spouse, or if Executive's spouse has predeceased Executive, to
Executive's estate, in a single sum payment. Such payment will made within sixty
(60) days after Executive's death.
<PAGE>

          5.   Amendment or Termination. This Agreement may be amended or
               ------------------------
terminated only upon the mutual agreement of Employer and Executive and only as
documented in a written amendment signed by both parties hereto.

          6.   Non-Alienation. No benefits under this Agreement shall be subject
               --------------
in any manner to anticipation, alienation, sale, transfer, assignment, pledge,
encumbrance, attachment, or garnishment by creditors of Executive or Executive's
spouse or estate, and any attempt to do so shall be void and unenforceable.
Such benefits shall not be subject to or liable for the debts, contracts,
liabilities, engagements, or torts of Executive or Executive's spouse or estate.

          7.   General Funds of Employer. Nothing contained in this Agreement
               -------------------------
and no action taken pursuant to the provisions of this Agreement shall create,
or be construed to create, a trust of any kind (except as provided in Paragraph
2), or a fiduciary relationship between Employer and Executive, Executive's
spouse or estate, or any other person. To the extent that any person acquires a
right to receive payments from Employer under this Agreement, such right shall
be greater than the right of an unsecured general creditor of Employer.

          8.   No Effect on Benefit Plans. No deferred compensation payable
               --------------------------
under this Agreement shall be deemed salary or other compensation to Executive
for the purpose of computing benefits to which he may be entitled under any
pension or profit-sharing plan or other arrangement of Employer for providing
benefits to its employees.

          9.   Interpretation of Agreement. Employer shall have full power and
               ---------------------------
authority to interpret, construe, and administer this Agreement.  Employer's
interpretation and construction thereof, and actions thereunder, including any
valuation of the Account, or its determination of the amount or recipient of
payments to be made therefrom, shall be binding and conclusive on all persons
for all purposes.  Employer shall not be liable to any person for any action
taken or omitted in connection with the interpretation and administration of
this Agreement unless attributable to its own willful misconduct.

          10.  Binding Nature. This Agreement shall be binding upon and inure
               --------------
to the benefit of Employer, its successors and assigns, and Executive and
Executive's heirs, executors, administrators, and legal representatives.

          11.  Applicable Law. This Agreement shall be construed in accordance
               --------------
with and governed by the law of the Commonwealth of Pennsylvania.
<PAGE>

          IN WITNESS WHEREOF, Employer has caused this Agreement to be executive
by its duly authorized officer and Executive has hereunto set his hand and seal
on the date first above written.

                                             Employer:

                                             SELECT MEDICAL CORPORATION, a
                                             Delaware corporation



                                             By: /s/ Michael E. Tarvin
                                                --------------------------------
                                                  Michael E. Tarvin,
                                                  Senior Vice President

                                             Executive:



                                             By: /s/ Rocco A. Ortenzio
                                                --------------------------------
                                                 Rocco A. Ortenzio