<PAGE>
                                                                   Exhibit 10.18

                              AMENDED AND RESTATED
                              --------------------
                        DEFERRED COMPENSATION AGREEMENT
                        -------------------------------


     AGREEMENT, (the "Agreement") entered into as of 23 day of
October, 1996, by and between RITE AID CORPORATION, with offices at
30 Hunter Lane, Camp Hill, Pennsylvania, 17011 ("Corporation") and FRANKLIN C.
BROWN ("Employee") and KAREN S. BROWN ("Brown").

                              W I T N E S S E T H
     WHEREAS, Employee and Corporation are the parties to a Deferred
Compensation Agreement dated __________________, 19__ (the "Original
Agreement"); and

     WHEREAS, the parties wish to amend and restate the Original Agreement in
its entirety; and

     WHEREAS, Employee is rendering valuable services to Corporation and
Corporation desires that Employee continue to render such services to
Corporation; and

     WHEREAS, to assist Employee and his finally in providing for the
contingencies of death, disability and old age dependency, Corporation and
Employee desire to enter into this Agreement to provide Employee with deferred
compensation with the intention that this Agreement supersede the Original
Agreement; and

     WHEREAS, Employee wishes to designate Brown as the owner of all rights to
receive payment of Employee's deferred compensation;

     NOW, THEREFORE, in recognition and consideration of the foregoing and of
services heretofore rendered by Employee to Corporation, and as a material
inducement to Employee to
<PAGE>

continue his service, Corporation Employee and Brown, each intending to be
legally bound, agree as follows:

          1.   Definitions.
               -----------

               (a) Retirement Allowance:  One twelfth (1/12th) of sixty percent
                   --------------------
(60%) of Employee's Highest Annual Compensation.

               (b) Highest Annual Compensation:  The highest annual salary paid
                   ---------------------------
to or accrued for Employee in or with respect to the last four (4) fiscal years
of Corporation next preceding the Retirement Date plus the highest annual bonus
paid to or accrued for Employee with respect to the last four (4) fiscal years
next preceding Retirement Date. Annual bonuses shall not include the value of
stock options and payments of multi-year performance awards. If the Retirement
Date is fixed by the death of Employee, the fiscal year in which the death
occurred shall be included as the fourth fiscal year as if Employee had served
through the end of said fiscal year and Employee's salary had continued to be
paid at the rate in effect at the date of death and Employee had been paid a
bonus with respect to that year commensurate with the bonuses paid to other
comparably compensated Corporation executives.

               (c) Retirement Date:  The date on which Employee's employment
                   ---------------
with Corporation terminates for any reason whatsoever, including, but not
limited to, the retirement or resignation of Employee, the termination of
Employee by Corporation with or without cause or the death or disability of
Employee.

               (d) Designated Beneficiary:  Brown shall be the sole initial
                   ----------------------
Designated Beneficiary and shall possess all of the rights to receive the
payment of Employee's deferred compensation under this Agreement.  Upon the
death of Brown, the personal representatives of

                                       2
<PAGE>

the estate of Brown (and upon termination of the estate, the beneficiaries
thereof) shall succeed to Brown's rights under this Agreement.

               (e) Change in Control:  As defined in Paragraph 4 below.
                   -----------------

               (f) Board of Directors:  The Board of Directors of Corporation in
                   ------------------
office at the time in question.

          2.   Retirement Allowance Payments.  On the first day of the month
               -----------------------------
following the Retirement Date of Employee, and on the first day of each
consecutive month thereafter, Corporation shall pay to the Designated
Beneficiary the Retirement Allowance and shall continue to pay same until the
later of the following dates:  (a) the date of death of Brown; (b) two hundred
forty (240) months after the Retirement Date.

          3.   Retirement Allowance CPI Adjustments:  The amount of Retirement
               ------------------------------------
Allowance shall be adjusted upward, beginning in the first month after each 48
month period following the first date on which Retirement Allowance is paid, in
direct proportion as the cost of living may have increased from Retirement Date
to date of each such adjustment, utilizing for this purpose the U.S. City
Average All Items Consumers Price Index for all Urban Consumers published by the
U.S. Department of Labor on the date hereof or if such index is discontinued,
the nearest equivalent index.  If the adjustment provided for in the prior
sentence would cause a decrease in the Retirement Allowance then in effect, no
adjustment shall be made for such 48 month period.

          4.   Change in Control.
               -----------------

               (a) In the event of Change in Control of Corporation, as
hereinafter defined, all Retirement Allowance payments shall, at the option of
Brown, exercised by written notice to Corporation at anytime following the
Change in Control, become immediately due and

                                       3
<PAGE>

payable, calculated as follows: (x) If the Change in Control occurs prior to the
Retirement Date (i) the amount of the Retirement Allowance shall be calculated
as if the date of the Change in Control were the Retirement date, (ii) the
Retirement Allowance shall be multiplied by Two Hundred Forty (240), and (iii)
the product shall be reduced to present discounted value as of the date of the
Change in Control by applying the Annual Discount Factor (as hereinafter
defined); and (y) If the Change in Control occurs after the Retirement Date (i)
the amount of the Retirement Allowance shall be multiplied by an amount equal to
Two Hundred Forty (240) less the number of Retirement Allowance payments that
have been made prior to the date of the Change in Control, and (ii) the product
shall be reduced to present discounted value as of the date of the Change in
Control by applying the Annual Discount Factor. The "Annual Discount Factor"
shall be determined as of the date of the written notice to Corporation referred
to above and shall be a percentage equal to (A) the yield on five-year United
States Treasury Notes as sold at the most recent government auction or (B) if
there has been no government auction sale of such Notes within the sixty-day
period preceding the date of such written notice to Corporation, the average
asked yield of United States Treasury Bonds and Notes maturing between 58 months
and 62 months from the date of the written notice to Corporation, as published
in the Wall Street Journal, or if not so published, the nearest equivalent
source. If clause (B) is applicable and the publication of the average asked
yield is no longer available, then the most nearly comparable rate shall be used
in lieu thereof.

               (b) For purposes of this Agreement, a Change of Control of
Corporation shall be deemed to have occurred upon the earliest to occur of the
following events:  (i) the date the stockholders of Corporation (or the Board of
Directors, if stockholder action is not required) approve a plan or other
arrangement pursuant to which Corporation will be dissolved, divided or

                                       4
<PAGE>

liquidated, or (ii) the date the stockholders of Corporation (or the Board of
Directors, if stockholder action is not required) approve a definitive agreement
to sell or otherwise dispose of substantially all of the assets of Corporation
(in one transaction or a series of transactions) other than to an affiliate of
Corporation, or (iii) the date the stockholders of Corporation (or the Board of
Directors, if stockholder action is not required) and the stockholders of
another constituent corporation (or its board of directors, if stockholder
action is not required) have approved a definitive agreement to merge or
consolidate Corporation with or into such other corporation, other than, in
either case, a merger or consolidation of Corporation in which holders of
securities of Corporation which vote generally in the election of directors
outstanding immediately prior to the merger or consolidation will have, directly
or indirectly, at least eighty percent (80%) of the total voting power of the
surviving corporation's voting securities immediately after the merger or
consolidation, which voting securities are to be held in the same proportion as
such holders ownership of voting securities of Corporation immediately before
the merger or consolidation, or (iv) the date any entity, person or group,
within the meaning of Section 13(d)(3) or Section 14(d)(2) of the Securities
Exchange Act of 1934, as amended, (other than (A) Corporation or any of its
subsidiaries or any employee benefit plan (or related trust) sponsored or
maintained by Corporation or any of its subsidiaries or (B) any person who, on
the date of this Agreement, shall have been the beneficial owner of, or have
voting control over, shares of voting securities of Corporation possessing more
than twenty percent (20%) of the aggregate voting power of Corporation's
outstanding voting securities) shall have become the beneficial owner of, or
shall have obtained voting control over, more than twenty percent (20%) of the
aggregate voting power of Corporation's then outstanding voting securities, or
(v) the first day after the date of this Agreement when directors are elected
such that a majority of the Board of Directors shall

                                       5
<PAGE>

have been members of the Board of Directors for less than two (2) years, unless
the nomination for election of each new director who was not a director at the
beginning of such two (2) year period was approved by a vote of at least two-
thirds of the directors then still in office who were directors at the beginning
of such period.

               (c) In the event that Brown becomes entitled to payments under
Subparagraph 4(a) hereof which, together with any other amounts payable to Brown
and Employee, are determined to be "excess parachute payments" as such term is
defined in Section 280G(b) of the Internal Revenue Code of 1986, as amended (the
"Code") and subject to the excise tax imposed by Section 4999 of the Code
(hereinafter referred to, as the "Excise Tax"), Corporation shall pay to
Employee or Brown, depending upon which of them incurs the Excise Tax, an
additional amount (hereinafter referred to as the "Gross-Up Payment") such that
the net amount received under this Paragraph 4, after the deduction of any
Excise Tax on such Corporation payments under Subparagraph 4(a), and any
federal, state and local income tax (including any applicable interest,
penalties, Excise Tax and any other applicable excise taxes) upon the payment
provided for by this Subparagraph 4(c), shall be equal to the amount of
Corporation's payments in the absence of the imposition of such Excise Tax and
the payments provided for by this Subparagraph 4(c).  The determination of any
Gross-Up Payment payable under this Subparagraph 4(c) shall be determined by
independent tax counsel selected by Corporation's independent auditors subject
to Employees' consent or, if he has died, the consent of Brown.  For purposes of
determining the amount of the Gross-Up Payment, Employee or Brown, depending
upon which of them incurs the Excise Tax, shall be deemed to pay federal income
taxes at the highest individual marginal rate of federal income taxation in the
calendar year in which the Gross-Up Payment is to be made and state and local
income taxes at the

                                       6
<PAGE>

highest individual marginal rates of taxation in the state and locality of
Employee's or Brown's residence in such calendar year. The Gross-Up Payment will
be paid as promptly as practicable following the determination described in this
Subparagraph 4(c), or, if earlier, the assertion of a deficiency under Code
Section 4999 by the Internal Revenue Service against Corporation, Employee or
Brown which independent tax counsel believes has a high probability of success,
but in no event shall the Gross-Up Payment be paid later than five business days
preceding the earlier of the due date for, or the payment of, the Excise Tax to
the Internal Revenue Service. In the event that the Excise Tax is subsequently
determined to be less than the amount taken into account at the time of the
initial determination hereunder, the recipient of the Gross-Up Payment shall
repay to Corporation, within five business days of the date that a refund of all
or a portion of the Excise Tax is received form the Internal Revenue Service,
the amount of such refund plus the after-tax amount of any interest received
from the Internal Revenue Service with respect to such refund (the after-tax
amount to be determined in accordance with the assumptions described previously
in this Subparagraph 4(c)). In the event that the Excise Tax is determined to
exceed the amount taken into account at the time of the initial determination
hereunder, Corporation shall make an additional Gross-Up Payment in respect of
such excess at the time that the excess is determined but in no event later than
five business days preceding the earlier of the due date for, or the payment of,
the excess to the Internal Revenue Service.

          5.   Forfeiture Under Certain Circumstances.  Notwithstanding the
               --------------------------------------
foregoing, Corporation shall have no further obligation to make Retirement
Allowance payments to Brown if either of the following shall occur:

               (a) Employee is discharged by Corporation for good cause (as
hereinafter defined) by order of the Board of Directors, or it is found by the
Board of Directors

                                       7
<PAGE>

that Employee has committed an act which would have resulted in his discharge
for good cause had it been brought to the attention of the Board of Directors.
As used herein, "good cause" shall mean and be limited to Employee's conviction
of a felony involving his personal dishonesty materially injurious to
Corporation.

               (b) Employee undertakes employment with any chain drug store
business or any chain health and beauty aid business anywhere in the continental
United States, or becomes affiliated with any such business in an advisory or
consulting capacity, and does not cease such activities within thirty (30) days
after his receipt of written notice from Corporation describing such activities
and demanding that he cease.

          6.   Interest on Late Payments.  Any payment of Retirement Allowance
               -------------------------
not paid within ten (10) days following the due date thereof, including but not
limited to payments accelerated pursuant to Subparagraph 4(a) hereof, shall bear
interest until paid in full, both before and after judgment, at a variable rate
equal to three (3) percentage points per annum in excess of the prime rate in
effect from time to time as published in the Wall Street Journal, or if not so
published, the nearest equivalent source.  If the publication of the prime rate
is no longer available then the most nearly comparable rate shall be used in
lieu thereof.

          7.   Tax Withholding.  If by reason of any federal, state or local tax
               ---------------
laws, rules or regulations, Corporation shall be required to withhold any
amounts on payments made under this Agreement, Corporation shall be entitled to
deduct and withhold any such amounts from any payments to be made to Employee or
Brown, whether under the terms of this Agreement or otherwise.  If for whatever
reason Corporation is unable to or has failed to satisfy the requirements of
such withholding from such payments, the recipient of such payments shall make
available to Corporation, promptly when required, sufficient funds to meet the
requirement

                                       8
<PAGE>

of such withholding, and Corporation shall be entitled to take and
authorize such action as it may deem advisable in order to have such funds
available when required.

          8.   Life Insurance.  Corporation shall maintain life insurance
               --------------
coverage on Employee for the balance of his life, in such manner as Corporation
and Employee may agree, with a death benefit of no less than $1,500,000.

          9.   Transfer Prohibited.  The rights to the Retirement Allowance
               -------------------
payments under this Agreement may not be anticipated, alienated, sold, assigned,
pledged, encumbered or otherwise transferred.

          10.  Unfunded Obligation.  The amounts payable in accordance with this
               -------------------
Agreement shall not constitute a segregation of funds or other property for the
benefit of Employee, Brown or any other person.  Nothing contained in this
Agreement and no action taken pursuant to the provisions of this Agreement shall
create or be construed as creating a trust of any kind or a fiduciary
relationship between Corporation and Employee, Brown or any other person, and
neither Employee, Brown nor any other person shall have rights with respect to
the benefits under this Agreement greater than the rights of an unsecured
general creditor of the Corporation.

          11.  Successors and Assigns.  This Agreement shall be binding upon and
               ----------------------
inure to the benefit of Corporation, its successors and assigns, and Employee,
Brown and their respective beneficiaries, heirs, executors, administrators and
legal representatives.

          12.  Waivers, Severability.  Failure to insist upon strict compliance
               ---------------------
with any of the terms, covenants or conditions hereof shall not be deemed a
waiver of such term, covenant or condition, nor shall any waiver or
relinquishment of any right or power hereunder at any one time or more times be
deemed a waiver or relinquishment of such right or power at any other

                                       9
<PAGE>

time or times. If any clause, sentence, paragraph, section or part of this
Agreement shall be held by any court of competent jurisdiction to be invalid,
such judgment shall not affect, impair or invalidate the remainder hereof.

          13.  Applicable Law.  This Agreement shall be subject to and construed
               --------------
in accordance with the laws of the State of Pennsylvania where it is made
without giving effect to principles of conflict of law.

          IN WITNESS WHEREOF, Corporation has caused this Agreement to be
executed by its duly authorized officer, and Employee and Brown have hereunder
set their hands, as of the date first above written.



RITE AID CORPORATION



By: /s/ Martin L. Grass               /s/ Franklin C. Brown
    _________________________         ____________________________
        Martin L. Grass                   Franklin C. Brown

Its:  Chairman                       /s/ Karen S. Brown
                                     _____________________________
                                         Karen S. Brown

                                       10