<PAGE>   1

                                                                  EXHIBIT 10.1

                               SECOND AMENDMENT TO
                                CREDIT AGREEMENT


          This SECOND AMENDMENT TO CREDIT AGREEMENT (the "Amendment"), effective
as of August 4, 1997, is entered into by and among THE HOUSTON EXPLORATION
COMPANY, a Delaware corporation (the "Company"); TEXAS COMMERCE BANK NATIONAL
ASSOCI ATION, a national banking association ("TCB"), with offices at 712 Main
Street, Houston, Texas 77002, as Agent (TCB, in its capacity as Agent
hereinafter called "Agent") for itself and each of the other banks or lending
institutions (collectively the "Banks") that is a signatory hereto or which
hereinafter becomes a party to the "Credit Agreement" (hereinafter defined); and
the Banks.

                             PRELIMINARY STATEMENTS:

          A. The Company, the Agent and TCB, as the sole Bank, entered into that
certain Credit Agreement dated as of July 2, 1996 (as amended by First Amendment
to Credit Agreement and Security Agreement dated as of August 30, 1996, and as
the same may from time to time be further amended, supplemented or modified, the
"Credit Agreement") under the terms of which TCB, as the sole Bank, agreed to
make available to the Company a revolving line of credit not to exceed, in the
aggregate, $150,000,000 at any one time outstanding.

          B. Pursuant to separate Assignments and Acceptances dated as of the
date hereof, TCB has assigned to each of the Banks (other than TCB) that is a
signatory hereto an undivided interest in and to all of its rights and
obligations under the Credit Agreement, as set forth on Schedule I attached to
each respective Assignment and Acceptance, and the "Commitment" (as defined in
the Credit Agreement) of each Bank shall be the amount set forth opposite such
Bank's name on the signature pages hereof under the caption "Commitment".

          C. The Company, the Banks and the Agent hereby mutually desire to
amend and modify certain terms of the Credit Agreement.

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

          Section 1. Certain Defined Terms. All capitalized terms used herein
(including in the preliminary statements hereof) and not otherwise defined shall
have the meanings set forth in the Credit Agreement.

          Section 2.  Amendments to Certain Definitions. Certain terms defined
in Section 1.02 of the Credit Agreement are hereby amended as follows:


                   (a) The term "Agreement" is hereby amended to mean the Credit
          Agreement, as amended hereby and as the same may from time to time be
          further amended or supplemented.


                                             

<PAGE>   2



                   (b) The term "Applicable Margin" is hereby amended in its
          entirety to read as follows:

                   "Applicable Margin" shall mean at the time of calculation,
          with respect to any Loan, calculated as a function of the type of such
          Loan, the following rate per annum as applicable:

<TABLE>
<CAPTION>

       THRESHOLD AMOUNT            FIXED RATE LOAN APPLICABLE   BASE RATE LOAN APPLICABLE
         UTILIZATION                   MARGIN PERCENTAGE           MARGIN PERCENTAGE
       ----------------            --------------------------   -------------------------
<S>                                <C>                          <C>
Less than 25%                                .375%                        0%
Greater than or equal to 25%                  .50%                        0%
  but less than 50%
Greater than or equal to 50%                 .625%                        0% 
  but less than 75%
Greater than or equal to 75%                  .75%                        0%
  but less than 100%
Greater than or equal to                    1.125%                        0%
  100%
</TABLE>

          Section 3.  Additional Definition.  Section 1.02 of the Credit 
Agreement is hereby further amended and supplemented by adding thereto the 
following new definition, to read in entirety as follows:

                   "EBITDA" shall mean, for any period, the sum of Consolidated
          Net Income for such period plus the following expenses or charges to
          the extent deducted from Consolidated Net Income in such period:
          interest, taxes, depreciation, depletion and amortization.

          Section 4.  Letters of Credit.  Clause (i) of Section 2.01(b) of the 
Credit Agreement is hereby amended in its entirety to read as follows:

          (i) During the period from and including the Closing Date to and
          including the Drawdown Termination Date, the Banks agree to extend
          credit to the Company at any time and from time to time by
          participating in the issuance, renewal, extension or reissuance of
          Letters of Credit pursuant to this Agreement; provided, that all such
          Letters of Credit issued on or after the Closing Date shall be issued
          by the Agent; and further provided, however, the aggregate LC Exposure
          at any one time shall not exceed the lesser of (1) $5,000,000, or (2)
          (A) the lesser of (x) the Borrowing Base, or (y) the aggregate
          Commitments, as then in effect, minus (B) the aggregate principal
          amount of all Loans then outstanding.

          Section 5.  Fees.  The grid set forth at the end of Section 2.04(b) 
is hereby amended in its entirety to read as follows:

                                       -2-


<PAGE>   3





             Threshold Amount
                Utilization                                      Issuance Fee
             ----------------                                    ------------
Less than 25%                                                        .375%
Greater than or equal to 25% but less than 50%                        .50%
Greater than or equal to 50% but less than 75%                       .625%
Greater than or equal to 75% but less than 100%                       .75%
Greater than or equal to 100%                                        1.125%

        Section 6. Borrowing Base; Threshold Amount. For the period from and
after the date of this Amendment to and including the date of the next
redetermination of the Borrowing Base in accordance with Section 2.09 of the
Credit Agreement, the amount of the Borrowing Base shall be $130,000,000.00, and
the amount of the Threshold Amount shall be $130,000,000.00.

        Section 7.  Investments. Section 9.05 of the Credit Agreement is hereby
amended by deleting the words "FRI or" from the 12th line thereof.

        Section 8.  Minimum Consolidated Net Worth.  Section 9.12 of the Credit
Agreement is hereby be amended in its entirety to read as follows:

               Section 9.12 Interest Coverage Ratio. The Company will not permit
        its Interest Coverage Ratio as of the end of any fiscal quarter of the
        Company (calculated quarterly at the end of each fiscal quarter) to be
        less than 2.50 to 1.00. For the purposes of this Section 9.12, 'Interest
        Coverage Ratio' shall mean the ratio of (i) EBITDA for the four fiscal
        quarters ending on such date to (ii) cash interest payments made for
        such four fiscal quarters of the Company and its Subsidiaries.

        Section 9. Debt to Total Capitalization Ratio. Section 9.13 of the
Credit Agreement is hereby amended by deleting therefrom the percentage "55%"
found in clause (ii) and substituting therefore the amount 60%.

        Section 10. Exhibit F. Exhibit F attached to the Credit Agreement is
hereby amended, restated and replaced in its entirety by Exhibit F attached to
this Amendment.

        Section 11. Conditions Precedent. In addition to any and all other
applicable conditions precedent contained in the Credit Agreement, the
obligations of the Agent and the Banks to enter into this Amendment are
conditioned upon receipt by each of the Banks of (i) their respective Note, duly
completed and executed by the Company, and (ii) their Assignment and Acceptance
duly completed and executed by the parties thereto.

        Section 12. Ratification.  The Company acknowledges and ratifies the 
Credit Agreement as amended hereby, and agrees and acknowledges that all the 
terms thereof as amended hereby (a)

                                       -3-


<PAGE>   4



are hereby brought forward for the benefit of the Banks and the Agent and (b)
shall remain in full force and effect.

        Section 13.  Counterparts.  This Amendment may be signed in any number 
of counterparts, each of which shall be construed as an original, but all of 
which together shall constitute one and the same instrument.

        Section 14. References. On and after the date hereof, the terms
"Agreement," "hereof," "herein," "hereunder," and terms of like import when used
in the Credit Agreement shall, except where the context otherwise requires,
refer to the Credit Agreement, as amended and supplemented by this Amendment.

        Section 15.  Choice of Law.  This Amendment shall be governed by and 
construed in accordance with the laws of the State of Texas.

        Section 16. Final Agreement of the Parties. THIS AMENDMENT, THE CREDIT
AGREEMENT, THE NOTES AND OTHER SECURITY INSTRUMENTS CONSTITUTE A "LOAN
AGREEMENT" AS DEFINED IN SECTION 26.02(a) OF THE TEXAS BUSINESS AND COMMERCE
CODE, AND 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 UNWRITTEN ORAL AGREEMENTS BETWEEN THE PARTIES.


                            [SIGNATURE PAGES FOLLOW]



                                       -4-


<PAGE>   5



          IN WITNESS WHEREOF, the parties hereto have caused this Agreement to
be executed by their respective officers thereunto duly authorized as of the
date first above written.

                                               COMPANY:

                                               THE HOUSTON EXPLORATION COMPANY



                                               By: /s/ Thomas W. Powers
                                                  --------------------------
                                                  Thomas W. Powers
                                                  Senior Vice President




                               (Signature Page 1)


<PAGE>   6



                                         AGENT AND BANKS:

Commitment: $50,000,000.00               TEXAS COMMERCE BANK NATIONAL
                                         ASSOCIATION, Individually as a Bank and
                                         in its capacity as Agent



                                         By: /s/ Paul J. Nidoh
                                            -------------------------
                                            Paul J. Nidoh
                                            Vice President




                               (Signature Page 2)


<PAGE>   7



Commitment: $30,000,000.00              CIBC INC.



                                        By: /s/ Aleksandra K. Dymanus
                                           ---------------------------
                                        Name: Aleksandra K. Dymanus
                                        Title: Authorized Signatory




                               (Signature Page 3)


<PAGE>   8



Commitment: $20,000,000.00              FIRST UNION NATIONAL BANK



                                        By: /s/ Michael J. Kolosowsky
                                           ------------------------------
                                        Name:  Michael J. Kolosowsky
                                        Title:    Vice President




                               (Signature Page 4)


<PAGE>   9



Commitment: $30,000,000.00              THE BANK OF NOVA SCOTIA


                                        By:      THE BANK OF NOVA SCOTIA,
                                                 ATLANTA AGENCY



                                        By: /s/ F.C.H. Ashby
                                           ------------------------
                                        Name: F.C.H. Ashby
                                        Title: Senior Manager Loan Operations



                               (Signature Page 5)


<PAGE>   10


Commitment: $20,000,000.00              PNC BANK, N.A.



                                        By: /s/ John Way
                                           --------------------------
                                        Name:  John Way
                                        Title: Commercial Banking Officer




                               (Signature Page 6)





<PAGE>   11
                                   EXHIBIT F

                                    FORM OF

                      ASSIGNMENT  AND ACCEPTANCE AGREEMENT

         ASSIGNMENT AND ACCEPTANCE AGREEMENT ("Agreement") dated as of
________________, 199___ between: _______________________________ (the
"Assignor") and __________________________  (the "Assignee").

                                    RECITALS

         A.      The Assignor is a party to the Credit Agreement dated as of
July 2, 1996 (as amended and supplemented and in effect from time to time, the
"Credit Agreement") among THE HOUSTON EXPLORATION COMPANY, a Delaware
corporation (the "Company"), each of the lenders that is or becomes a party
thereto as provided in Section 12.06 of the Credit Agreement (individually,
together with its successors and assigns, a "Bank", and collectively, together
with their successors and assigns, the "Banks"), and TEXAS COMMERCE BANK
NATIONAL ASSOCIATION, in its individual capacity, ("TCB") and as agent for the
Banks (in such capacity, together with its successors in such capacity, the
"Agent").

         B.      The Assignor proposes to sell, assign and transfer to the
Assignee, and the Assignee proposes to purchase and assume from the Assignor,
[all][a portion] of the Assignor's Commitment, outstanding Loans and its pro
rata share of the outstanding LC Exposure, all on the terms and conditions of
this Agreement.

         C.      In consideration of the foregoing and the mutual agreements
contained herein, and for other good and valuable consideration, the receipt
and sufficiency of which are hereby acknowledged, the parties hereto agree as
follows:


                                   ARTICLE I

                                  DEFINITIONS.

         Section 1.01      Definitions.  All capitalized terms used but not 
defined herein have the respective meanings given to such terms in the Credit 
Agreement.

         Section 1.02      Other Definitions.  As used herein, the following 
terms have the following respective meanings:

                 "Assigned Interest" shall mean all of Assignor's (in its
         capacity as a "Bank") rights and obligations (i) under the Credit
         Agreement and the other Security Instruments in respect of the
         Commitment of the Assignor in the principal amount equal to
         $____________________, including, without limitation, any obligation
         to participate prorata in any LC Exposure, and (ii) to make Loans
         under its Commitment and any right to receive payments for the Loans





                                      F-1
<PAGE>   12
         outstanding under the Commitment assigned hereby of
         $__________________ (the "Loan Balance"), plus the interest and fees
         which will accrue from and after the Assignment Date.

                 "Assignment Date" shall mean _____________________, 199___.


                                   ARTICLE II

                              SALE AND ASSIGNMENT.

         Section 2.01      Sale and Assignment.  On the terms and conditions 
set forth herein, effective on and as of the Assignment Date, the Assignor
hereby sells, assigns and transfers to the Assignee, and the Assignee hereby
purchases and assumes from the Assignor, all of the right, title and interest
of the Assignor in and to, and all of the obligations of the Assignor in
respect of, the Assigned Interest.  Such sale, assignment and transfer is
without recourse and, except as expressly provided in this Agreement, without
representation or warranty.
        
         Section 2.02      Assumption of Obligations.  The Assignee agrees with
the Assignor (for the express benefit of the Assignor and the Borrower) that
the Assignee will, from and after the Assignment Date, perform all of the
obligations of the Assignor in respect of the Assigned Interest. From and after
the Assignment Date: (a) the Assignor shall be released from the Assignor's
obligations in respect of the Assigned Interest, and (b) the Assignee shall be
entitled to all of the Assignor's rights, powers and privileges under the
Credit Agreement and the other Security Instruments in respect of the Assigned
Interest.
        
         Section 2.03      Consent by Agent.  By executing this Agreement as 
provided below, in accordance with Section 12.06(b) of the Credit Agreement, 
the Agent hereby acknowledges notice of the transactions contemplated by this 
Agreement and consents to such transactions.


                                  ARTICLE III

                                   PAYMENTS.

         Section 3.01      Payments.  As consideration for the sale, assignment
and transfer contemplated by Section 2.01 hereof, the Assignee shall, on the
Assignment Date, assume Assignor's obligations in respect of the Assigned
Interest and pay to the Assignor an amount equal to the Loan Balance, if any. 
An amount equal to all accrued and unpaid interest and fees shall be paid to
the Assignor as provided in Section 3.02 (iii) below.  Except as otherwise
provided in this Agreement, all payments hereunder shall be made in Dollars and
in immediately available funds, without setoff, deduction or counterclaim.
        
         Section 3.02      Allocation of Payments.  The Assignor and the 
Assignee agree that (i) the Assignor shall be entitled to any payments of
principal with respect to the Assigned Interest made prior to the Assignment
Date, together with any interest and fees with respect to the Assigned Interest
accrued prior to the Assignment Date, (ii) the Assignee shall be entitled to
any payments of
        




                                      F-2
<PAGE>   13
principal with respect to the Assigned Interest made from and after the
Assignment Date, together with any and all interest and fees with respect to
the Assigned Interest accruing from and after the Assignment Date, and (iii)
the Agent is authorized and instructed to allocate payments received by it for
account of the Assignor and the Assignee as provided in the foregoing clauses.
Each party hereto agrees that it will hold any interest, fees or other amounts
that it may receive to which the other party hereto shall be entitled pursuant
to the preceding sentence for account of such other party and pay, in like
money and funds, any such amounts that it may receive to such other party
promptly upon receipt.

         Section 3.03      Delivery of Notes.  Promptly following the receipt 
by the Assignor of the consideration required to be paid under Section 3.01
hereof, the Assignor shall, in the manner contemplated by Section 12.06(b) of
the Credit Agreement, (i) deliver to the Agent (or its counsel) the Note held
by the Assignor and (ii) notify the Agent to request that the Borrower execute
and deliver new Notes to the Assignor, if Assignor continues to be a Bank, and
the Assignee, dated the date of this Agreement in respective principal amounts
equal to the respective Commitment of the Assignor (if appropriate) and the
Assignee after giving effect to the sale, assignment and transfer contemplated
hereby.
        
         Section 3.04      Further Assurances.  The Assignor and the Assignee 
hereby agree to execute and deliver such other instruments, and take such other
actions, as either party may reasonably request in connection with the 
transactions contemplated by this Agreement.


                                   ARTICLE IV

                             CONDITIONS PRECEDENT.

         Section 4.01      Conditions Precedent.  The effectiveness of the 
sale, assignment and transfer contemplated hereby is subject to the 
satisfaction of each of the following conditions precedent:

                 (a)          the execution and delivery of this Agreement by
         the Assignor and the Assignee;

                 (b)          the receipt by the Assignor of the payment
         required to be made by the Assignee under Section 3.01 hereof; and

                 (c)          the acknowledgment and consent by the Agent
         contemplated by Section 2.03 hereof.





                                      F-3
<PAGE>   14
                                   ARTICLE V

                        REPRESENTATIONS AND WARRANTIES.

         Section 5.01      Representations and Warranties of the Assignor.  The
Assignor represents and warrants to the Assignee as follows:

                 (a)          it has all requisite power and authority, and has
         taken all action necessary to execute and deliver this Agreement and
         to fulfill its obligations under, and consummate the transactions
         contemplated by, this Agreement;

                 (b)          the execution, delivery and compliance with the
         terms hereof by Assignor and the delivery of all instruments required
         to be delivered by it hereunder do not and will not violate any
         Governmental Requirement applicable to it;

                 (c)          this Agreement has been duly executed and
         delivered by it and constitutes the legal, valid and binding
         obligation of the Assignor, enforceable against it in accordance with
         its terms;

                 (d)          all approvals and authorizations of, all filings
         with and all actions by any Governmental Authority necessary for the
         validity or enforceability of its obligations under this Agreement
         have been obtained;

                 (e)          the Assignor has good title to, and is the sole
         legal and beneficial owner of, the Assigned Interest, free and clear
         of all Liens, claims, participations or other charges of any nature
         whatsoever; and

                 (f)          the transactions contemplated by this Agreement
         are commercial banking transactions entered into in the ordinary
         course of the banking business of the Assignor.

         Section 5.02      Disclaimer.  Except as expressly provided
in Section 5.01 hereof, the Assignor does not make any representation or
warranty, nor shall it have any responsibility to the Assignee, with respect to
the accuracy of any recitals, statements, representations or warranties
contained in the Credit Agreement or in any certificate or other document
referred to or provided for in, or received by any Bank under, the Credit
Agreement, or for the value, validity, effectiveness, genuineness, execution,
effectiveness, legality, enforceability or sufficiency of the Credit Agreement,
the Notes or any other document referred to or provided for therein or for any
failure by the Borrower or any other Person (other than Assignor) to perform
any of its obligations thereunder prior or for the existence, value, perfection
or priority of any collateral security or the financial or other condition of
the Borrower or the Subsidiaries [or any other obligor or guarantor], or any
other matter relating to the Credit Agreement or any other Security Instrument
or any extension of credit thereunder.





                                      F-4
<PAGE>   15
         Section 5.03      Representations and Warranties of the Assignee.  The
Assignee represents and warrants to the Assignor as follows:

                 (a)          it has all requisite power and authority, and has
         taken all action necessary to execute and deliver this Agreement and
         to fulfill its obligations under, and consummate the transactions
         contemplated by, this Agreement;

                 (b)          the execution, delivery and compliance with the
         terms hereof by Assignee and the delivery of all instruments required
         to be delivered by it hereunder do not and will not violate any
         Governmental Requirement applicable to it;

                 (c)          this Agreement has been duly executed and
         delivered by it and constitutes the legal, valid and binding
         obligation of the Assignee, enforceable against it in accordance with
         its terms;

                 (d)          all approvals and authorizations of, all filings
         with and all actions by any Governmental Authority necessary for the
         validity or enforceability of its obligations under this Agreement
         have been obtained;

                 (e)          the Assignee has fully reviewed the terms of the
         Credit Agreement and the other Security Instruments and has
         independently and without reliance upon the Assignor, and based on
         such information as the Assignee has deemed appropriate, made its own
         credit analysis and decision to enter into this Agreement;

                 (f)          the transactions contemplated by this Agreement
         are commercial banking transactions entered into in the ordinary
         course of the banking business of the Assignee.


                                   ARTICLE VI

                                 MISCELLANEOUS.

         Section 6.01      Notices.  All notices and other communications 
provided for herein (including, without limitation, any modifications of, or
waivers, requests or consents under, this Agreement) shall be given or made in
writing (including, without limitation, by telex or telecopy) to the intended
recipient at its "Address for Notices" specified below its name on the
signature pages hereof or, as to either party, at such other address as shall
be designated by such party in a notice to the other party.
        
         Section 6.02      Amendment, Modification or Waiver.  No provision of 
this Agreement may be amended, modified or waived except by an instrument in 
writing signed by the Assignor and the Assignee, and consented to by the Agent.

         Section 6.03      Successors and Assigns.  This Agreement shall be 
binding upon and inure to the benefit of the parties hereto and their 
respective successors and permitted assigns.  The representations and 
warranties made herein by the Assignee are also made for the benefit of the
Agent





                                      F-5
<PAGE>   16
and the Borrower, and the Assignee agrees that the Agent and the Borrower are
entitled to rely upon such representations and warranties.

         Section 6.04      Assignments.  Neither party hereto may assign any of
its rights or obligations hereunder except in accordance with the terms of the 
Credit Agreement.

         Section 6.05      Captions.  The captions and section headings 
appearing herein are included solely for convenience of reference and are not 
intended to affect the interpretation of any provision of this Agreement.

         Section 6.06      Counterparts.  This Agreement may be executed in any
number of counterparts, each of which shall be identical and all of which, 
taken together, shall constitute one and the same instrument, and each of the 
parties hereto may execute this Agreement by signing any such counterpart.

         Section 6.07      Governing Law.  This Agreement shall be governed by,
and construed in accordance with, the law of the State of Texas.

         Section 6.08      Expenses.  To the extent not paid by the Borrower 
pursuant to the terms of the Credit Agreement, each party hereto shall bear its
own expenses in connection with the execution, delivery and performance of this
Agreement.

         Section 6.09      Waiver of Jury Trial.  EACH OF THE PARTIES HERETO 
HEREBY IRREVOCABLY WAIVES, TO THE FULLEST EXTENT PERMITTED BY LAW, ANY AND ALL
RIGHT TO TRIAL BY JURY IN ANY LEGAL PROCEEDING ARISING OUT OF OR RELATING TO
THIS AGREEMENT OR THE TRANSACTIONS CONTEMPLATED HEREBY.
        




                                      F-6
<PAGE>   17
         IN WITNESS WHEREOF, the parties hereto have caused this Assignment
Agreement to be executed and delivered as of the date first above written.

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

                                        Address for Notices:
                                        
                                         
                                        ---------------------------------------
                                         
                                        ---------------------------------------
                                         
                                        ---------------------------------------
                                        
                                        
                                        Telecopier No.:   
                                                        -----------------------
                                        Telephone No.:   
                                                        -----------------------
                                        Attention:        
                                                        -----------------------





                                      F-7
<PAGE>   18
                                        ASSIGNEE
                                        --------
                                        
                                         
                                        ---------------------------------------
                                        
                                        
                                        By:       
                                            -----------------------------------
                                        Name:
                                        Title:
                                        
                                        Address for Notices:
                                        
                                         
                                        ---------------------------------------
                                         
                                        ---------------------------------------
                                         
                                        ---------------------------------------
                                        
                                        Telecopier No.:   
                                                        -----------------------
                                        Telephone No.:   
                                                        -----------------------
                                        Attention:        
                                                        -----------------------


ACKNOWLEDGED AND CONSENTED TO:

-------------------------------,
as Agent



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





                                      F-8