<PAGE>

                                                                    EXHIBIT 10.4

                                THIRD AMENDMENT

      THIS THIRD AMENDMENT (this "Amendment") dated as of June 24, 2004 to the
Credit Agreement referenced below is by and among PSYCHIATRIC SOLUTIONS, INC, a
Delaware corporation (the "Borrower"), the Guarantors identified on the
signature pages hereto, the Lenders identified on the signature pages hereto and
BANK OF AMERICA, N.A., as Administrative Agent.

                                   WITNESSETH

      WHEREAS, a revolving credit facility of up to $125 million has been
extended to the Borrower pursuant to the terms of that Credit Agreement (as
amended, modified and supplemented from time to time, the "Credit Agreement")
dated as of January 6, 2004 among the Borrower, the Guarantors identified
therein, the Lenders identified therein and the Administrative Agent; and

      WHEREAS, the Borrower has requested that the Lenders agree to certain
modifications of the Credit Agreement and the Lenders have agreed to the
requested modifications on the terms and conditions set forth herein.

      NOW, THEREFORE, IN CONSIDERATION of the premises and other good and
valuable consideration, the receipt and sufficiency of which are hereby
acknowledged, the parties hereto agree as follows:

      1. Defined Terms. Capitalized terms used herein but not otherwise defined
herein shall have the meanings provided to such terms in the Credit Agreement.

      2. Amendment. Section 8.11(a) of the Credit Agreement is amended to read
as follows:

            (a) Consolidated Total Leverage Ratio. Permit the Consolidated Total
            Leverage Ratio as of the end of any fiscal quarter of the Borrower
            to be greater than (i) for each fiscal quarter ending prior to June
            30, 2005, 4.50:1.0, (ii) for the fiscal quarter ending June 30, 2005
            and each fiscal quarter ending thereafter, 4.00:1.0.

      3. Conditions Precedent. This Amendment shall become effective as of the
date hereof upon receipt by the Administrative Agent of counterparts of this
Amendment executed by the Borrower, the Guarantors and the Lenders.

      4. Reaffirmation of Representations and Warranties. The Borrower
represents and warrants that the representations and warranties set forth in the
Loan Documents are true and correct as of the date hereof (except those that
expressly relate to an earlier period).

      5. Reaffirmation of Guaranty. Each Guarantor (i) acknowledges and consents
to all of the terms and conditions of this Amendment, (ii) affirms all of its
obligations under the Loan Documents and (iii) agrees that this Amendment and
all documents executed in connection herewith do not operate to reduce or
discharge such Guarantor's obligations under the Credit Agreement or the other
Loan Documents.

      6. Reaffirmation of Security Interests. The Borrower and each Guarantor
(i) affirms that each of the Liens granted in or pursuant to the Loan Documents
are valid and subsisting and (ii) agrees that this Amendment shall in no manner
impair or otherwise adversely effect any of the Liens granted in or pursuant to
the Loan Documents.

      7. No Other Changes. Except as modified hereby, all of the terms and
provisions of the Loan Documents shall remain in full force and effect.

<PAGE>

      8. Counterparts. This Amendment may be executed in any number of
counterparts, each of which when so executed and delivered shall be deemed an
original and it shall not be necessary in making proof of this Amendment to
produce or account for more than one such counterpart.

      9. Governing Law. This Amendment shall be deemed to be a contract made
under, and for all purposes shall be construed in accordance with, the laws of
the State of New York.

                            [Signature Pages Follow]

                                       2
<PAGE>

      IN WITNESS WHEREOF, each of the parties hereto has caused a counterpart of
this Amendment to be duly executed and delivered as of the date first above
written.

BORROWER:

PSYCHIATRIC SOLUTIONS, INC., a Delaware corporation

By: /s/ Brent Turner
    ----------------
Name:
Title:

GUARANTORS:

AERIES HEALTHCARE CORPORATION, a Delaware corporation
AERIES HEALTHCARE OF ILLINOIS, INC., an Illinois corporation
BOUNTIFUL PSYCHIATRIC HOSPITAL, INC., a Utah corporation
COLLABORATIVE CARE CORPORATION, a Tennessee corporation
EAST CAROLINA PSYCHIATRIC SERVICES CORPORATION, a North Carolina corporation
GREAT PLAINS HOSPITAL, INC., a Missouri corporation
GULF COAST TREATMENT CENTER, INC., a Florida corporation
H.C. CORPORATION, an Alabama corporation
HAVENWYCK HOSPITAL INC., a Michigan corporation
HSA HILL CREST CORPORATION, an Alabama corporation
HSA OF OKLAHOMA, INC., an Oklahoma corporation
INFOSCRIBER CORPORATION, a Delaware corporation
LAURELWOOD CENTER, INC., a Mississippi corporation
MICHIGAN PSYCHIATRIC SERVICES, INC., a Michigan corporation
PREMIER BEHAVIORAL SOLUTIONS, INC., a Delaware corporation
PREMIER BEHAVIORAL SOLUTIONS OF ALABAMA, INC., a Delaware corporation
PSI CEDAR SPRINGS HOSPITAL, INC., a Delaware corporation
PSI COMMUNITY MENTAL HEALTH AGENCY MANAGEMENT, INC., a Tennessee corporation
PSI-EAP, INC., a Delaware corporation
PSI HOSPITALS, INC., a Delaware corporation
PSYCHIATRIC MANAGEMENT RESOURCES, INC., a California corporation
PSYCHIATRIC PRACTICE MANAGEMENT OF ARKANSAS, INC., a Tennessee corporation
PSYCHIATRIC SOLUTIONS HOSPITALS, INC., a Delaware corporation
PSYCHIATRIC SOLUTIONS OF ALABAMA, INC. a Tennessee corporation
PSYCHIATRIC SOLUTIONS OF ARIZONA, INC., a Delaware corporation
PSYCHIATRIC SOLUTIONS OF FLORIDA, INC., a Tennessee corporation
PSYCHIATRIC SOLUTIONS OF LOUISIANA, INC., a Delaware corporation
PSYCHIATRIC SOLUTIONS OF NORTH CAROLINA, INC., a Tennessee corporation
PSYCHIATRIC SOLUTIONS OF OKLAHOMA, INC., a Delaware corporation
PSYCHIATRIC SOLUTIONS OF TENNESSEE, INC., a Tennessee corporation
RAMSAY MANAGED CARE, INC., a Delaware corporation

By: /s/ Brent Turner
    ----------------
Name:
Title:

                           [SIGNATURE PAGES CONTINUE]

<PAGE>

RAMSAY TREATMENT SERVICES, INC., a Delaware corporation
RAMSAY YOUTH SERVICES OF FLORIDA, INC., a Delaware corporation
RAMSAY YOUTH SERVICES OF GEORGIA, INC., a Delaware corporation
RAMSAY YOUTH SERVICES OF SOUTH CAROLINA, INC., a Delaware corporation
RHCI SAN ANTONIO, INC., a Delaware corporation
SOLUTIONS CENTER OF LITTLE ROCK, INC., a Tennessee corporation
SUNSTONE BEHAVIORAL HEALTH, INC., a Tennessee corporation
THE COUNSELING CENTER OF MIDDLE TENNESSEE, INC., a Tennessee corporation
TRANSITIONAL CARE VENTURES, INC., a Delaware corporation
TRANSITIONAL CARE VENTURES (TEXAS), INC., a Delaware corporation
PSI TEXAS HOSPITALS, LLC, a Texas limited liability company
THERAPEUTIC SCHOOL SERVICES, LLC, an Oklahoma limited liability company

By: /s/ Brent Turner
    ----------------
Name:
Title:

NEURO INSTITUTE OF AUSTIN, L.P., a Texas limited partnership
TEXAS CYPRESS CREEK HOSPITAL, L.P., a Texas limited partnership
TEXAS LAUREL RIDGE HOSPITAL, L.P., a Texas limited partnership
TEXAS OAKS PSYCHIATRIC HOSPITAL, L.P., a Texas limited partnership
TEXAS SAN MARCOS TREATMENT CENTER, L.P., a Texas limited partnership
TEXAS WEST OAKS HOSPITAL, L.P., a Texas limited partnership

By: PSI TEXAS HOSPITALS, LLC, its general partner

    By: /s/ Brent Turner
        ----------------
    Name:
    Title:

H.C. PARTNERSHIP, an Alabama general partnership

By: H.C. CORPORATION, its general partner
    HSA HILL CREST CORPORATION, its general partner

    By: /s/ Brent Turner
        ----------------
    Name:
    Title:

                           [SIGNATURE PAGES CONTINUE]

<PAGE>

ADMINISTRATIVE AGENT:       BANK OF AMERICA, N.A.,
                            as Administrative Agent

                            By: /s/ Michael Brashler
                                -----------------------
                            Name: Michael Brashler
                            Title: Vice President

LENDERS:                    BANK OF AMERICA, N.A.,
                            as a Lender, L/C Issuer and Swing Line Lender

                            By: /s/ Elizabeth L. Knox
                                -----------------------
                            Name: Elizabeth L. Knox
                            Title: SVP

                            LEHMAN COMMERCIAL PAPER, INC.

                            By: /s/ Francis Chang
                                -----------------------
                            Name: Francis Chang
                            Title: Authorized Signatory

                            GENERAL ELECTRIC CAPITAL CORPORATION

                            By: /s/ Steve J. Warner
                                -----------------------
                            Name: Steve J. Warner
                            Title: Duly Authorized Signatory

                            AMSOUTH BANK

                            By: /s/ William H. Berrell
                                -----------------------
                            Name: William H. Berrell
                            Title: Vice President

                           SUNTRUST BANK

                            By:
                                -----------------------
                            Name:
                            Title:

                            FIFTH THIRD BANK, N.A. (Tennessee)

                            By: /s/ Sandy Hamrick
                                -----------------------
                            Name: Sandy Hamrick
                            Title:

                            UNION PLANTERS BANK, N.A.

                            By: /s/ Craig Gardella
                                -----------------------
                            Name: Craig Gardella
                            Title: Senior Vice-President

                           [SIGNATURE PAGES CONTINUE]

<PAGE>

                            FIRST TENNESSEE BANK NATIONAL ASSOCIATION

                            By: /s/ L. A. Galyon IV
                                ----------------------
                            Name: L. A. Galyon IV
                            Title: Vice President

                            US BANK NATIONAL ASSOCIATION

                            By:
                                ----------------------
                            Name:
                            Title:

                            BANK ONE, N.A.

                            By: /s/ Timothy K. Boyle
                                ----------------------
                            Name: Timothy K. Boyle
                            Title: First Vice President

                            LASALLE BANK NATIONAL ASSOCIATION

                            By: /s/ Sarah Rusher
                                ----------------------
                            Name: Sarah Rusher
                            Title: First Vice President