EXHIBIT 5 [LETTERHEAD OF THOMPSON & KNIGHT, P.C.] August 22, 1997 Petroglyph Energy, Inc. 6209 North Highway 61 Hutchinson, Kansas 67502 Dear Sirs and Madams: We have acted as counsel for Petroglyph Energy, Inc., a Delaware corporation (the "Company"), in connection with the preparation of the Company's Registration Statement on Form S-1, as amended (the "Registration Statement"), filed with the Securities and Exchange Commission under the Securities Act of 1933, as amended, relating to the proposed offering of 2,333,333 shares (the "Shares") of the Company's common stock, par value $.01 per share (the "Common Stock"), together with 350,000 additional shares of Common Stock (the "Additional Shares") subject to the underwriters' over-allotment option as described in the Registration Statement. We understand that the Shares and any Additional Shares are to be sold pursuant to the terms of an Underwriting Agreement (the "Underwriting Agreement") in substantially the form filed as an exhibit to the Registration Statement. In connection with the foregoing, we have examined the originals or copies, certified or otherwise authenticated to our satisfaction, of the Registration Statement and such corporate records of the Company, certificates of public officials and of officers of the Company, and other agreements, instruments and documents as we have deemed necessary as a basis for the opinions hereinafter expressed. Where facts material to the opinions hereinafter expressed were not independently established by us, we have relied upon the statements of officers of the Company, where we deemed such reliance appropriate under the circumstances. Based upon the foregoing and in reliance thereon, and subject to the assumptions and qualifications hereinafter specified, it is our opinion that: 1. The Company is a corporation duly incorporated and validly existing in good standing under the laws of the State of Delaware. 2. Upon (a) the taking of action by the Board of Directors of the Company (or a duly constituted committee thereof) to determine the price at which the Shares and Additional Shares are to be sold under the Underwriting Agreement and (b) the sale of the Shares and the Additional Shares in accordance with the terms of the Underwriting Agreement for the price so determined, the Shares and any Additional Shares sold by the Company will be duly authorized by all necessary corporate action on the part of the Company, validly issued, fully paid and nonassessable. Petroglyph Energy, Inc. August 22, 1997 Page 2 We are members of the Bar of the State of Texas only and do not purport to be experts on the laws of any state or jurisdiction other than the State of Texas and the United States. Insofar as the opinions expressed herein relate to matters governed by Delaware law, we have relied solely upon a reading of the applicable statutes and the corporate records of the Company and certificates of public officials and officers of the Company referenced above with respect to the opinions given herein. We hereby consent to the filing of this opinion as Exhibit 5 to the Registration Statement and to the reference to us under the caption "Legal Matters" in the prospectus forming a part of the Registration Statement. In giving this consent, we do not thereby admit that we are within the category of persons whose consent is required under Section 7 of the Securities Act or the rules or regulations of the Commission thereunder. Respectfully submitted, THOMPSON & KNIGHT, A Professional Corporation By: /s/ Michael L. Bengtson --------------------------------------------- Michael L. Bengtson, Attorney