<PAGE>

                                                                   Exhibit 10(f)






                         GUARANTY DATED AUGUST 12, 2003
              BETWEEN FIRST ENERGY CORP. AND ATLAS RESOURCES, INC.
                 TO GAS PURCHASE AGREEMENT DATED MARCH 31, 1999
              BETWEEN NORTHEAST OHIO GAS MARKETING, INC., AND ATLAS
             ENERGY GROUP, INC., ATLAS RESOURCES, INC., AND RESOURCE
                                  ENERGY, INC.









<PAGE>

FirstEnergy(R)                                                 76 South Main St.
                                                               Akron, Ohio 44308

--------------------------------------------------------------------------------

                                                                  1-800-633-4766

     Guaranty dated as of August 12, 2003 by and between FirstEnergy Corp., an
Ohio corporation, with its principal place of business at 76 South Main Street,
Akron, OH 44308 ("Guarantor") and Atlas Resources Inc., a Pennsylvania
corporation, with its principal place of business at 311 Rouser Rd., Coraopolis,
PA 15108 ("Seller"). Seller, together with its affiliates Atlas Energy Group,
Inc., an Ohio Corporation, Resource Energy, Inc., a Delaware corporation, and
Viking Resources Corporation, an Ohio Corporation, entered into a Gas Purchase
Agreement for the purchase and sale of natural gas ("Sales Agreement") to
FirstEnergy Solutions Corp.,("Customer"), a subsidiary of the Guarantor.

     In consideration thereof, and as an inducement for the extension of credit
by the Seller to the Customer, the Guarantor hereby absolutely and
unconditionally guarantees to the Seller, its permitted successors and assigns
pursuant to this letter (this "Guaranty"), the prompt payment (within three (3)
business days of demand by the Seller) of any and all amounts that are or may
hereafter become due and payable (taking into account all applicable grace
periods) from the Customer to the Seller by reason of the Sales Agreement (the
"Obligations"), to fully perform the Sales Agreement, as well as any
indebtedness under the Sales Agreement (regardless of whether such indebtedness
be in the form of book accounts, promissory notes, trade acceptances, checks,
drafts, or other evidence of indebtedness, together with late fees, service
charges or liquidated damages (but only if, and to the extent, provided for in
the Sales Agreement) and interest at the rate specified therein) This Guaranty
shall be a guaranty of payment, and not of collection, and the Seller shall not
be required to take any proceedings or exhaust its remedies against the Customer
prior to the exercise of its rights and remedies against the Guarantor, as
guarantor.

     The Guarantor hereby agrees to reimburse the Seller for all sums paid to it
by the Customer under the Sales Agreement, which must subsequently be returned
by the Seller to the Customer as a preference or fraudulent transfer under the
Federal Bankruptcy Code, any applicable state law and for any other reason.

     Notwithstanding anything else in this Guaranty to the contrary, the
obligation and liability of Guarantor hereunder shall not (i) be effective or
enforceable with respect to any Obligation, liability or claim relating in any
way to consequential, indirect, punitive or exemplary damages of any kind
whatsoever, whether owing by Company or otherwise, and (ii) exceed Fifteen
Million Dollars ($15,000,000) in the aggregate. This Guaranty is a continuing
guaranty and shall remain in full force and effect from August 12, 2002 until at
least March 31, 2005, and shall continue on a monthly basis thereafter, unless
terminated by either party with thirty (30) days written notice to the other
party.

     If the Guarantor shall be adjudicated bankrupt under the Federal Bankruptcy
Laws, or if any petition for any relief under any of such laws shall be filed by
or against the Guarantor, or if the Guarantor shall make an assignment for the
benefit of creditors or shall apply for a receiver for all or any part of its
property, or if the Guarantor shall become insolvent or unable to pay its debts
as they mature, then and in any such event all of the Obligations shall
forthwith become and be immediately due and payable by the Guarantor.

     Notice of demand by the Seller shall be sent by either certified mail,
return receipt requested, or hand delivery, to the respective addresses
specified above, with notices to the Guarantor sent to the attention of the
Credit Manager and notices to the Seller sent to the attention of both John
Ranieri and Nancy McGurk, and shall be deemed to be received on the day that
such writing is delivered to the intended recipient thereof.

                                        1


<PAGE>


     The Guarantor hereby acknowledges that any modification of the Sales
Agreement shall not affect the liability of the Guarantor with respect hereto.
Except as provided above with respect to the requirement of notice from the
Seller to the Guarantor of a payment demand, the Guarantor hereby waives, to the
extent permitted by law, the requirements of the giving of any notice,
including, but not limited to, (a) notice of the acceptance of this Guaranty by
the Seller; (b) notice of the entry into the Sales Agreements between the
Customer and the Seller and of any modifications thereto; (c) notice of any
extension of time for the payment of any sums due and payable to the Seller
under the Sales Agreement; (d) with respect to any notes or evidence of
indebtedness received by the Seller from the Customer, notice of presentment,
notice of adverse facts, protest or notice of protest; and (e) notice of any
defaults by or disputes with the Customer.

     This Guaranty shall not be affected by the taking of any checks, notes or
other obligations, secured or unsecured, in any amount, purportedly in payment
of the whole or any part of any Obligations or by reason of any extension of
time given to, or any indulgences shown to, the Customer by the Seller, or by
the making, execution and delivery of any oral or written agreement or
agreements affecting said Obligations. The Guarantor's liability hereunder shall
not be impaired or discharged by reason of any reorganization, insolvency,
bankruptcy or similar proceeding (whether voluntary or involuntary) modifying
the Seller's rights and remedies against the Customer with regard to any
Obligation or liability of the Customer to the Seller under the Sales Agreement.

     The Guarantor also waives diligence, presentment, protest to or upon
Customer with respect to the Obligations. This Guaranty shall be construed as a
continuing, absolute and unconditional guarantee of payment without regard to
(a) the validity, regularity or enforceability of the Sales Agreement, any of
the Obligations or any other collateral security therefor or guarantee a right
of offset with respect thereto at any time or from time to time by Seller, (b)
until Seller shall have been paid in full, any right by Guarantor to subrogation
of indemnification, or (c) any other circumstance whatsoever (with or without
notice to or knowledge of the Seller or Guarantor) which constitutes, or might
be construed to constitute, an equitable or legal discharge of the Customer for
the Obligations, or of Guarantor under this Guaranty, in bankruptcy or in any
other instance. When pursuing its rights and remedies hereunder against
Guarantor, the Seller may, but shall be under no obligation to, pursue such
rights and remedies as it may have against Customer or any other party or
against any collateral security or guarantee for the Obligations or any right to
offset with respect thereto, and any failure by Seller to pursue such other
rights or remedies or to collect any payments from the Customer or any such
other party or to realize upon any such collateral security or guarantee or to
exercise any such right of offset, or any release of Customer or any such other
party or of any such collateral security, guarantee or right of offset, shall
not relieve Guarantor of any liability hereunder, and shall not impair or affect
the rights and remedies, whether express, implied or available as a matter of
law, of Seller against Guarantor.

     Notwithstanding anything else in this Guaranty to the contrary, Guarantor
shall be permitted and entitled to raise all defenses to payment hereunder that
are available to Company, other than those defenses available to the Company
solely as a result of bankruptcy, insolvency, reorganization and other similar
proceedings.

     This Guaranty shall bind the Guarantor for any and all of the Customer's
purchases of natural gas from the Seller, or the Seller's production affiliates,
Resource Energy, Inc., Viking Resources Corporation, and Atlas Energy Group,
Inc.

     This Guaranty shall remain in full force and effect and be binding in
accordance with and to the extent of its terms upon Guarantor and its successors
and assigns thereof, and shall inure to the benefits of the Seller, and its
respective successors, transferees, affiliates and assigns, until all
Obligations and the obligations of Guarantor under this Guaranty shall been
satisfied by payment in full.

     The Guarantor represents and warrants, as the date hereof, that this
Guaranty has been duly authorized, executed and delivered by the Guarantor.

                                        2


<PAGE>


     This Guaranty shall not be assigned or modified without the written consent
of each of the Guarantor and the Seller and shall not be affected by any change
in the relationship between Guarantor and the Customer. This Guaranty shall not
be relied upon, or enforced, by any person other than the Guarantor, the
Customer, and the Seller.

     This Guaranty shall be governed by and construed in accordance with the
laws of the State of Ohio, without regard to the conflict of law rules thereof.
The Guarantor and the Seller, by accepting this Guaranty, submit to the
non-exclusive jurisdiction of the Courts of the State of Ohio and the United
States District Court of Northern District of Ohio.

     This Guaranty revokes any prior guaranty issued by the Guarantor to the
Seller for the obligations of the Customer.

     IN WITNESS WHEREOF, the Guarantor has caused this Guaranty to be executed
by its duly authorized officer as of the date first above written.

                                           FIRSTENERGY CORP.

                                           Randy Scilla
                                           -----------------------
                                           Randy Scilla
                                           Assistant Treasurer






                                       3