EXHIBIT 10.50 INTERCREDITOR AND COLLATERAL SHARING AGREEMENT This INTERCREDITOR AND COLLATERAL SHARING AGREEMENT, dated April 13, 2006 (as amended, modified or supplemented, this "AGREEMENT"), is by and among HUDSON UNITED CAPITAL, A DIVISION OF TD BANKNORTH, N.A., a national banking association ("HUDSON UNITED CAPITAL"), as the agent pursuant to the Construction and Term Loan Agreement, dated the date hereof (the "SENIOR LOAN AGREEMENT"), among Pacific Ethanol Madera LLC, a Delaware limited liability company ("BORROWER"), the lenders from time to time party thereto (the "SENIOR LENDERS"), and Hudson United Capital, as administrative agent for the Senior Lenders (in such capacity, together with its successors and assigns, the "SENIOR AGENT"), LYLES DIVERSIFIED, INC., a California corporation, as lender (in such capacity, together with its permitted successors and assigns, the "JUNIOR LENDER" and, together with the Senior Lenders, the "LENDERS"), pursuant to the Amended and Restated Term Loan Agreement, dated as of April 13, 2006 (the "JUNIOR LOAN AGREEMENT"), by and between the Junior Lender and Borrower, and PACIFIC ETHANOL MADERA LLC, a Delaware limited liability company. RECITALS WHEREAS, pursuant to the Senior Loan Agreement, the Senior Lenders have agreed to make certain construction and term loans (the "SENIOR LOANS") to Borrower; WHEREAS, the Senior Loans are and will be secured by first priority pledges of, mortgages on and security interests in the Collateral (as defined below); WHEREAS, pursuant to the Junior Loan Agreement, Junior Lender has made one or more loans to Borrower in the aggregate original principal amount of $5,100,000 (such loans and all other obligations of Borrower to Junior Lender pursuant to the Junior Loan Agreement, the "JUNIOR LOAN"); WHEREAS, the obligations of Borrower in respect of the Junior Loan have been secured by liens on a portion of the Collateral, which liens are intended to be junior to the liens securing the Senior Loans; and WHEREAS, the Senior Agent and the Junior Lender desire by entering into this Agreement to define the rights and responsibilities as between them concerning the Collateral; NOW, THEREFORE, in consideration of the premises and the mutual agreements contained herein, and other good and valuable consideration, the receipt and adequacy of which are hereby acknowledged, the parties hereto agree as follows: ARTICLE I DEFINITIONS Section 1.1 DEFINITIONS. Capitalized terms used and not otherwise defined in this Agreement have the meanings given to those terms in Schedule X hereto. ARTICLE II SENIOR AGENT'S RIGHT TO FORECLOSE Section 2.1 SENIOR AGENT'S RIGHT TO FORECLOSE. Junior Lender hereby agrees that nothing in the Junior Loan Agreement or the related security documents or this Agreement will restrict any right of the Senior Agent or the Senior Lenders to foreclose on or exercise any other right or remedy with respect to the Senior Agent's and the Senior Lenders' security interests in the Collateral, and the Senior Agent or any Senior Lender may foreclose on or exercise any other right or remedy with respect to the Collateral, to the exclusion of any similar right or remedy that the Junior Lender many have, in any manner or order and at any time. ARTICLE III RIGHTS OF THE LENDERS Section 3.1 LIEN PRIORITY. The Junior Lender acknowledges and agrees that (x) it does not have, and will not assert, any Lien against any asset of Borrower other than the Junior Lender Collateral and (y) the Liens on the Collateral granted to the Senior Agent for the benefit of the Senior Lenders pursuant to the security documents executed in connection with the Senior Loan Agreement will at all times be superior in priority to any Lien on the Collateral, including the Junior Lender Collateral, granted to the Junior Lender pursuant to the security documents executed in connection with the Junior Loan Agreement, regardless of the order or time of the granting of any Lien, the order or time as to which any Lien attached to any or all of the Collateral or the order or time of any UCC filing or other filing or recording. Section 3.2 SUBORDINATION. (a) The Junior Lender may not commence any action or proceeding against Borrower to exercise remedies under the documents relating to the Junior Obligations with respect to any Collateral, or receive any proceeds from the sale or disposition thereof, unless and until the Senior Obligations have been paid in full. (b) The Senior Agent and the Senior Lenders may, at any time and from time to time, without the consent of or notice to the Junior Lender, without incurring responsibility or liability to the Junior Lender and without impairing or releasing any right or obligation of the Senior Agent or the Senior Lenders hereunder: 2 (i) amend the Senior Loan Agreement in any manner or enter into or amend in any manner any other agreement relating to the Senior Obligations; (ii) sell, exchange, release or otherwise deal with any property by whomsoever at any time pledged or mortgaged to secure, or howsoever securing, the Senior Obligations; (iii) release any Person liable in any manner for the payment or collection of the Senior Obligations, including without limitation Borrower; (iv) exercise or refrain from exercising any right against Borrower or any other Person; and (v) apply any sum by whomsoever paid or however realized to the Senior Obligations. (c) Subject to the payment in full of the Senior Obligations in cash, the Junior Lender will be subrogated to the Senior Agent's and the Senior Lenders' rights to receive payments or distributions in cash or property applicable to the Senior Obligations and, as among Borrower and its creditors other than the Senior Agent, the Senior Lenders and the Junior Lender, no such payment or distribution made to the Senior Agent or the Senior Lenders by virtue of this Agreement that otherwise would have been made to the Junior Lender will be deemed to be a payment by Borrower on account of the Junior Obligations, it being understood that the provisions of this Section 3.2(c) are intended solely for the purpose of defining the relative rights of the Junior Lender, the Senior Agent and the Senior Lenders. (d) The Junior Lender will not sell, assign, transfer or otherwise dispose of the Junior Obligations to any Person that is not an Affiliate of the Junior Lender without the prior written consent of the Senior Agent, which consent will not be unreasonably withheld or delayed. Section 3.3 NOTICES. The Junior Lender agrees that it will provide the Senior Agent with prompt notice of any default under the Junior Loan Agreement of which the Junior Lender has knowledge. ARTICLE IV APPLICATION OF COLLATERAL Section 4.1 PAYMENTS. Except as otherwise expressly provided in this Agreement, all amounts received by or available to the Senior Agent, the Senior Lenders or the Junior Lender in respect of proceeds from the disposition of any Collateral on which the Junior Lender has a lien will be applied as follows: 3 FIRST: Payment of all fees, costs and expenses of the Senior Agent in accordance with the Senior Loan Agreement to the extent not paid by Borrower; SECOND: Payment of all accrued and unpaid interest on the Senior Loans; THIRD: Payment of all other Senior Obligations due and owing to the Senior Lenders; FOURTH: Payment of all Junior Obligations due and owing to the Junior Lender; and FIFTH: As required by applicable law, payment of any remaining balance to Borrower or as Borrower may direct in writing. Section 4.2 RETURN OF COLLATERAL. The Junior Lender hereby agrees that (a) if at any time it receives proceeds from the disposition of any Collateral (other than in accordance with this Agreement), it will promptly pay or deliver the same to the Senior Agent for application in accordance with this Agreement and (b) it will not take or cause to be taken any action, including the commencement of any legal or equitable proceeding, if the purpose is to give it any preference or priority with respect to any Collateral. ARTICLE V TERMINATION Section 5.1 TERMINATION. This Agreement will terminate and cease to be of further effect upon the payment in full in cash of the Senior Obligations. ARTICLE VI MISCELLANEOUS PROVISIONS Section 6.1 BENEFIT OF AGREEMENT; COMPLIANCE WITH JUNIOR LOAN AGREEMENT. (a) Nothing in this Agreement, expressed or implied, gives or may be construed to give to any Person other than the Senior Agent and the Junior Lender any legal or equitable right, remedy or claim under this Agreement, or under any covenant or provision herein contained, all such covenants and provisions being for the sole benefit of the Senior Agent and the Junior Lender; PROVIDED, that Borrower will be entitled to rely on and benefit from the provisions of Sections 2.1, 3.2(a), 3.2(d) and 5.1 and Article VI of this Agreement. 4 (b) The Junior Lender acknowledges and agrees that none of (i) Borrower's execution of and compliance with the terms of this Agreement, (ii) Borrower's entering into the Senior Loan Agreement and the related loan and security documents and (iii) the grant and pledge by Borrower and its member of real and personal property as collateral security to the Senior Agent for the benefit of the Senior Lenders will result in a default under the Junior Loan Agreement and all such acts are taken (or will be deemed to have been taken) by Borrower in compliance with the Junior Loan Agreement. Section 6.2 SUCCESSORS OR ASSIGNS. This Agreement will be binding upon and inure to the benefit of and be enforceable by and against the respective permitted successors and assigns of the Senior Agent and the Junior Lender. Section 6.3 NOTICES. All notices, consents, certificates, waivers, documents and other communications required or permitted to be delivered to any party under the terms of this Agreement (a) must be in writing, (b) must be personally delivered, transmitted by a recognized courier service or transmitted by facsimile, and (c) must be directed to such party at its address or facsimile number set forth below. All notices will be deemed to have been duly given and received on the date of delivery if delivered personally, three (3) days after delivery to the courier if transmitted by courier, or the date of transmission with confirmation if transmitted by facsimile, whichever occurs first. Any party may change its address or facsimile number for purposes hereof by notice to all other parties. Addresses: Senior Agent: Hudson United Capital, a division of TD Banknorth, N.A. 101 Post Road East Westport, Connecticut 06880 Attn: Mr. Jerome P. Peters, Jr. Telephone: (203) 291-6639 Facsimile: (203) 291-6652 Junior Lender: Lyles Diversified Post Office Box 4376 Fresno, California 93744 Attn: Will Lyles Facsimile: (559) 487-7948 Borrower: Pacific Ethanol Madera LLC 31470 Avenue 12 Madera, California 93638 Attn: Jeff Manternach Facsimile: (559) 435-1478 5 Section 6.4 COUNTERPARTS. This Agreement may be executed in counterparts and by the different parties hereto in separate counterparts, each of which when so executed will be deemed to be an original and all of which taken together will constitute one and the same instrument. Section 6.5 HEADINGS DESCRIPTIVE. The headings of the several Articles and Sections of this Agreement are inserted for convenience only and will not in any way affect the meaning or construction of any provision of this Agreement. SECTION 6.6 GOVERNING LAW. THIS AGREEMENT WILL BE GOVERNED BY AND CONSTRUED IN ACCORDANCE WITH THE LAWS OF THE STATE OF NEW YORK, WITHOUT REGARD TO THE CONFLICT OF LAW PROVISIONS THEREOF (OTHER THAN SECTION 5.1401 OF THE GENERAL OBLIGATIONS LAW AND ANY SUCCESSOR STATUTE THERETO). Section 6.7 NO WAIVER; CUMULATIVE REMEDIES. No failure or delay on the part of any party in exercising any right, power or privilege hereunder will impair any such right, power or privilege or operate as a waiver thereof, nor will any single or partial exercise of any right, power or privilege hereunder preclude any other or further exercise thereof or the exercise of any other right, power or privilege hereunder or thereunder. The rights, powers and remedies herein or provided in this Agreement are cumulative and not exclusive of any right, power or remedy which any party would otherwise have. Section 6.8 SEVERABILITY. Any provision of this Agreement that is invalid or prohibited in any jurisdiction will, as to such jurisdiction, be ineffective and severable from the rest of this Agreement to the extent of such invalidity or prohibition, without impairing or affecting in any way the validity of any other provision of this Agreement or of such provision in other jurisdictions. The parties agree to replace any provision that is ineffective by operation of this Section 6.8 with an effective provision which as closely as possible corresponds to the spirit and purpose of such ineffective provision and this Agreement as a whole. Section 6.9 AMENDMENTS. Neither this Agreement nor any of the terms hereof may be changed, waived, discharged or terminated unless such change, waiver, discharge or termination is in writing signed by each party hereto. 6 IN WITNESS WHEREOF, the parties hereto, intending to be legally bound, have caused this Intercreditor and Collateral Sharing Agreement to be signed on the date first above written. HUDSON UNITED CAPITAL, A DIVISION OF TD BANKNORTH, N.A. as Senior Agent By /S/ JEROME P. PETERS, JR. -------------------------------------------------- Name: Jerome P. Peters, Jr. Title: Senior Vice President LYLES DIVERSIFIED, INC. as Junior Lender By /S/ MICHAEL F. ELKINS -------------------------------------------------- Name: Michael F. Elkins Title: Vice President/CFO PACIFIC ETHANOL MADERA LLC, as Borrower By /S/ RYAN TURNER -------------------------------------------------- Name: Title: 7 Schedule X to Intercreditor and Collateral Sharing Agreement ---------------------------- Definitions ----------- When used in the Intercreditor and Collateral Sharing Agreement, the following capitalized defined terms have the meanings set forth below: "AFFILIATE" means, with respect to any Person, any other Person (a) directly or indirectly controlling, controlled by, or under common control with, such Person, (b) directly or indirectly owning or holding or receiving any equity interest or other economic interest or benefit in such Person in excess of fifty percent (50%) or (c) in which such Person directly or indirectly controls any voting stock or other equity interest in excess of fifty percent (50%). For purposes of this definition, "control" (including with correlative meanings the terms "controlling," "controlled by" and "under common control with") means the possession, directly or indirectly, of the power to direct or cause the direction of the management and policies of a Person, whether through the ownership of voting securities, by contract or otherwise. "COLLATERAL" means, collectively, the "Collateral," as such term is defined in the Senior Security Agreement, the "Pledged Collateral," as such term is defined in the Senior Pledge Agreement and the "Mortgaged Property," as such term is defined in the Senior Mortgage, together with all other property, rights and interests from time to time subject, or purported to be subject, to the liens securing the payment of the Senior Obligations. "JUNIOR LENDER COLLATERAL" means the "Collateral," as defined in the Junior Loan Agreement. "JUNIOR OBLIGATIONS" means and includes the principal of, premium, if any, and interest on all liabilities of Borrower to the Junior Lender, together with all costs and expenses relating thereto, direct or contingent, now or hereafter existing, due or to become due to, or held or to be held by, the Junior Lender, whether created directly or acquired by assignment or otherwise, including without limitation all indebtedness of Borrower for principal of, premium, if any, and interest on the Junior Loans. "LIEN" means any lien, mortgage, pledge, security interest, charge or encumbrance of any kind (including any conditional sale or other title retention agreement, any lease in the nature thereof and any agreement to give any security interest). Schedule X Page 1 of 2 "PERSON" means and includes natural persons, corporations, limited partnerships, general partnerships, limited liability companies, joint stock companies, joint ventures, associations, companies, trusts, banks, trust companies and other organizations, whether or not legal entities, and governments and agencies and political subdivisions thereof. "SENIOR MORTGAGE" means the Deed of Trust, Assignment of Leases and Rents, Security Agreement and Fixture Filing to be entered into by and between Borrower and a trustee for the benefit of the Senior Agent. "SENIOR OBLIGATIONS" means and includes the principal amount of, premium, if any, and interest on all liabilities of Borrower to the Senior Agent and the Senior Lenders, together with all costs and expenses relating thereto, whether direct or contingent, now or hereafter existing, due or to become due to, or held or to be held by, the Senior Agent or the Senior Lenders, whether created directly or acquired by assignment or otherwise, including without limitation all indebtedness of Borrower for principal of, premium, if any, and interest on the Senior Loans. "SENIOR PLEDGE AGREEMENT" means the Membership Interest Pledge Agreement entered into between Pacific Ethanol Holding Co. LLC, on the one hand, and the Senior Agent, on the other hand. "SENIOR SECURITY AGREEMENT" means the Assignment and Security Agreement entered into between Borrower and the Senior Agent. "UCC" means the Uniform Commercial Code in effect in the State of New York or any other applicable jurisdiction from time to time. Schedule X Page 2 of 2