<PAGE>
                                                                    EXHIBIT 10.2


             THIRD AMENDMENT TO SECOND LIEN SECURED CREDIT AGREEMENT

         THIS THIRD AMENDMENT TO SECOND LIEN SECURED CREDIT AGREEMENT (this
"Amendment") is entered into as of October 14, 2004, among PetroQuest Energy,
L.L.C., a Louisiana limited liability company ("Borrower"); PetroQuest Energy,
Inc., a Delaware corporation ("Guarantor"); each of the Lenders from time to
time party hereto; and Macquarie Bank Limited, a bank incorporated in accordance
with the laws of Australia (in its individual capacity, "MBL"), as
administrative agent for the Lenders (in such capacity, together with its
successors in such capacity, the "Administrative Agent"). Capitalized terms used
but not defined in this Amendment have the meaning given them in the Credit
Agreement (defined below). Except as noted in this Amendment, all references to
sections, exhibits and schedules refer to sections in and exhibits and schedules
to the Credit Agreement.

                                   BACKGROUND

         A. Borrower and the Lenders have previously entered into a Second Lien
Secured Credit Agreement dated November 6, 2003 (as amended, the "Credit
Agreement") for the purpose of making available to Borrower a second lien,
secured term loan on a non-revolving basis.

         B. The Borrower has requested that the Lenders amend the Credit
Agreement pursuant to the terms and conditions of this Amendment to make certain
modifications to the Credit Agreement in connection with Borrower's acquisition
of the SJM Property (defined below).

                                   AGREEMENTS

         In consideration of the mutual covenants of Borrower and the Lenders
set forth in this Amendment and other good and valuable consideration, the
receipt and sufficiency of which are acknowledged by each of the parties,
Borrower and the Lenders agree as follows:

         1. Amendments to Credit Agreement.

                  (a) Additional Definitions. The Credit Agreement is amended to
         include each of the following additional definitions in alphabetical
         order:

                            "SJM Property" means the Leases and all other Real
                  Property described on Exhibit A-2 to the Third Amendment.

                           "SJM Purchase Agreement" means the Purchase and Sale
                  Agreement dated August 27, 2004 between Borrower, as buyer,
                  and SJM Inc., as seller, as supplemented and amended by the
                  Supplement and Amendment to Purchase and Sale Agreement dated
                  October 14, 2004, together with all documents executed and
                  delivered in connection with the transaction contemplated by
                  that agreement.
<PAGE>
                           "Third Amendment" means the Third Amendment to Credit
                  Agreement dated October 14, 2004 among Borrrower, Guarantor,
                  Administrative Agent and the Lenders party to the Credit
                  Agreement."

                  (b) Modifications to Credit Agreement. Section 7.11 of the
         Credit Agreement is deleted in its entirety and replaced with the
         following:

                           Section 7.11 Debt Threshold. Borrower shall not
                  permit the total Outstanding Debt to exceed sixty million
                  dollars ($60,000,000).

         2. Exhibits and Schedules. The following new exhibit attached to this
Amendment is made a part of the Credit Agreement for all purposes:

                  Exhibit A-2 - SJM Property

         3. Conditions to Effectiveness. This Amendment will become effective
upon the satisfaction of each of the following conditions:

                  (a) Borrower and Guarantor, as applicable, will execute and
         deliver to the Administrative Agent the following documents:

                           (i)  this Amendment;

                           (ii) a Mortgage covering the SJM Property; and


                           (iii) a Pledge Agreement covering all of the
                  outstanding capital stock of Pittrans, Inc.;

                           (iv) all other agreements, instruments, certificates,
                  financing statements and other documents necessary or
                  convenient, in the sole and absolute discretion of the
                  Lenders, to give effect to the transaction contemplated by
                  this Amendment;

                  (b) to the extent not previously received, Lenders have
         obtained a report prepared by a consultant acceptable to Lenders
         confirming (i) Borrower's and Operator's compliance, in all material
         respects, with all applicable Laws and regulatory requirements and (ii)
         that Borrower or Operator have all necessary material permits and
         licenses;

                  (c) to the extent not previously determined, an environmental
         consultant satisfactory to Lenders will investigate Borrower's
         compliance with all Environmental Laws, the results of which shall be
         satisfactory to Lenders in their sole discretion;

                  (d) Borrower will deliver to Lenders title opinions or other
         evidence of title relating to the SJM Properties showing Defensible
         Title to the SJM Properties vested in Borrower subject only to the
         Permitted Encumbrances and otherwise satisfactory in form and substance
         to Lenders, together with a letter from the issuer or issuers of such
         opinions, if the opinions are not addressed to the Lenders, to the
         effect that Lenders are authorized to rely on the title opinions;

                                       2
<PAGE>
                  (e) to the extent not previously delivered, Borrower will
         deliver to Lenders copies of the Basic Documents and all other
         documents and instruments as Lenders may reasonably request, all of
         which will be satisfactory, in form and substance, to Lenders;

                  (f) to the extent not previously delivered, Borrower will
         deliver to Lenders a certificate of insurance evidencing the coverages
         required under this Agreement and the Administrative Agent and the
         Lenders have been named as additional insureds in respect of such
         liability insurance policies and the Administrative Agent has been
         named as loss payee with respect to property loss insurance;

                  (g) no Material Adverse Effect has occurred;

                  (h) except for the obligations listed (or, with the consent of
         Lenders, summarized) on Schedule 9.2(n), there are no unpaid bills for
         improvements or services to the Properties that could give rise to
         mechanic's or materialmen's liens or any other similar encumbrance
         arising by operation of applicable law;

                  (i) the representations in each of the Loan Documents of
         Borrower and each other Person are true, complete and correct in all
         material respects;

                  (j) Lenders are satisfied, in their sole discretion, with the
         results of its due diligence examination of Borrower, and the SJM
         Properties, including, Borrower's proposed development of the SJM
         Properties, satisfactory information regarding existing Hydrocarbon
         sales, and all aspects of Borrower's existing and contemplated
         Hydrocarbon marketing activities;

                  (k) no suit or other proceeding is pending or threatened
         before any court or governmental agency seeking to restrain, enjoin or
         prohibit or declare illegal, or seeking damages from Borrower in
         connection with the transactions contemplated in this Agreement (or the
         operations contemplated as part of those transactions) or alleging the
         breach of any material contract;

                  (l) to the extent it has not done so previously, Borrower has
         reimbursed Lenders for all Related Costs for which invoices have been
         presented;

                  (m) each of the Operating Agreements affecting the SJM
         Properties will be satisfactory in form and substance to Lenders in
         their sole and absolute discretion;

                  (n) each of the documents executed and delivered by Borrower
         or Guarantor in connection with any amendments or supplements to the
         Senior Credit Facility will be satisfactory in form and substance to
         Lenders in their sole and absolute discretion;

                  (o) Borrower shall have prepared and submitted to Lenders a
         fifteen (15) month Annual Operating Budget for the further development
         of the Properties, and the budget is satisfactory in form and substance
         to Lenders in their sole and absolute discretion; and

                                       3
<PAGE>
                  (p) Lenders will be satisfied in their sole and absolute
         discretion with Borrower's Hydrocarbon hedging program with respect to
         the SJM Properties.

         4. Conditions Precedent to Making of Advances. In addition to the
conditions set forth in Section 3 above, the making of any additional Advance
under the Term Loan shall be subject to the following conditions:

                  (a) no Material Adverse Change has occurred and is continuing;

                  (b) all representations and warranties of Borrower and
         Guarantor set forth in this Agreement and the other Loan Documents
         shall be true and correct in all material respects as of the date of
         the Advance except to the extent such representations and warranties
         are expressly limited to an earlier date, in which case the
         representations and warranties shall be true and correct as of such
         specified earlier date;

                  (c) Borrower shall have delivered an Advance Request to the
         Administrative Agent in accordance with Section 2.2. Such Advance
         Request must be accompanied by copies of all approved AFEs included in
         the Annual Operating Budget as well as other supporting documentation
         satisfactory to Lenders evidencing the amount to be Advanced. Each AFE
         previously approved by Lenders in writing or other project description
         from the Annual Operating Budget delivered to Lender in conjunction
         with an Advance Request will detail all amounts Advanced to date by
         Lenders under that AFE or project description and the amount requested
         under the Advance Request. Notwithstanding anything to the contrary
         herein, Lenders shall not Advance any amount with respect to any
         specific activity included in the Annual Operating Budget that exceeds
         the amount included for such Well or project in the Annual Operating
         Budget inclusive of any amount included in the "Cost-Overrun" line-item
         of that Annual Operating Budget.

                  (d) the hedging requirements required by Section 6.17 shall be
         in full force and effect;

                  (e) no Event of Default has occurred or is continuing and no
         circumstance exists which but for the lapse of time or notice from the
         Lenders or both would become an Event of Default; and

                  (f) the SJM Purchase Agreement will be in form and substance
         satisfactory to Lenders in their sole and absolute discretion, and the
         transactions contemplated by that agreement will have closed
         (conditioned only on the payment of the purchase price specified in
         that agreement) on terms satisfactory to Lenders in their sole and
         absolute discretion.

         5. Reaffirmation of Representations and Warranties. To induce the
Lenders to enter into this Amendment, Borrower and Guarantor each hereby
reaffirms, as of the date hereof, its respective representations and warranties
contained in Article IV of the Credit Agreement and in all other documents
executed pursuant thereto, and additionally represents and warrants as follows:

                                       4
<PAGE>

                  (a) the execution and delivery of this Amendment and the
         performance by Borrower and Guarantor of their respective obligations
         under this Amendment are within such company's power, have been duly
         authorized by all necessary company action, have received all necessary
         governmental approval (if any shall be required), and do not and will
         not contravene or conflict with any provision of law or of the Charter
         Documents of Borrower or Guarantor or of any agreement binding upon
         either of them; and

                  (b) this Amendment represents the legal, valid and binding
         obligations of each of Borrower and Guarantor enforceable against each
         of them in accordance with its terms and subject only to bankruptcy,
         insolvency, reorganization, moratorium or other similar laws affecting
         the enforcement of creditors' rights generally.

         6. Ratification of Liens and Security Interests. Borrower hereby
acknowledges and ratifies the existence and priority of the Liens granted by
Borrower in favor of any of the Lenders or the Administrative Agent for the
benefit of the Lenders in and to the Collateral and represents, warrants and
covenants that such liens and security interests are valid, existing and in full
force and effect.

         7. Miscellaneous. This Amendment supersedes all prior agreements
(written or oral) between Borrower and the Lenders with regard to the subject
matters hereof. This Amendment is a Loan Document. Except as affected by this
Amendment, the Loan Documents are unchanged and continue in full force and
effect. However, in the event of any inconsistency between the terms of the
Credit Agreement as amended by this Agreement and any other Loan Document, the
terms of the Credit Agreement will control and the other document will be deemed
to be amended to conform to the terms of the Credit Agreement. All references to
the Credit Agreement will refer to the Credit Agreement as amended by this
Amendment. All references to the Collateral will include, without limitation,
the Collateral acquired or to be acquired pursuant to the SJM Purchase
Agreement. Borrower agrees that all Loan Documents to which it is a party
(whether as an original signatory or by assumption of the Obligations) remain in
full force and effect and continue to evidence its legal, valid and binding
obligations enforceable in accordance with their terms (as the same are affected
by this Amendment or are amended in connection with this Amendment). Borrower
releases Administrative Agent and each of the Lenders from any liability for
actions or failures to act in connection with the Loan Documents prior to the
date of this Amendment. Any course of dealing among Borrower, Administrative
Agent, any of the Lenders or any other Person will not be deemed to have altered
or amended the Credit Agreement or affected either Borrower's or the Lenders'
right to enforce the Credit Agreement as written. This Amendment will be binding
upon and inure to the benefit of each of the undersigned and their respective
successors and permitted assigns.

         8. Form. Each agreement, document, instrument or other writing to be
furnished to Administrative Agent or the Lenders under any provision of this
Amendment must be in form and substance satisfactory to the Lenders and their
respective counsel.

         9. Multiple Counterparts. This Amendment may be executed in more than
one counterpart, each of which shall be deemed an original, and all of which
constitute, collectively, one instrument; but, in making proof of this
instrument, it shall not be necessary to produce or account for more than one
such counterpart. It shall not be necessary for each of the parties to

                                       5
<PAGE>
execute the same counterpart of this Amendment so long as each of them executes
a counterpart of this Amendment.

         10. Governing Law. This Amendment and all transactions provided for in
this Amendment will be governed by, interpreted and construed under and enforced
pursuant to the laws of the State of Texas, without regard to its conflicts of
laws provisions.

         11. Final Agreement. THE LOAN DOCUMENTS, AS AMENDED BY OR IN CONNECTION
WITH THIS AMENDMENT, REPRESENT THE FINAL AGREEMENT BETWEEN THE PARTIES AND MAY
NOT BE CONTRADICTED BY EVIDENCE OF PRIOR, CONTEMPORANEOUS OR SUBSEQUENT ORAL
AGREEMENTS OF THE PARTIES. THERE ARE NO ORAL AGREEMENTS BETWEEN THE PARTIES.


                    [SIGNATURES BEGIN ON THE FOLLOWING PAGE]


                                       6
<PAGE>
         This Amendment is executed as of the date set forth in the preamble to
this Amendment.

                                    BORROWER:

                                    PETROQUEST ENERGY, L.L.C.,
                                    a Louisiana limited liability company


                                    By: /s/ Michael O. Aldridge
                                        ----------------------------------------
                                            Michael O. Aldridge
                                            Treasurer



                                    GUARANTOR:

                                    PETROQUEST ENERGY, INC.,
                                    a Delaware corporation



                                    By: /s/ Michael O. Aldridge
                                        ----------------------------------------
                                             Michael O. Aldridge
                                             Treasurer



                                    LENDERS:

                                    MACQUARIE BANK LIMITED,
                                    a bank incorporated in accordance with the
                                    laws of Australia



                                    By: /s/ Nicholas O'Kane
                                       -----------------------------------------

                                    Printed Name: Nicholas O'Kane
                                                 -------------------------------

                                    Title: Executive Director
                                          --------------------------------------



                                    By: /s/ Thomas Cullinan
                                       -----------------------------------------

                                    Printed Name: Thomas Cullinan
                                                 -------------------------------

                                    Title: Attorney
                                          --------------------------------------