NEW YORK (AP) _ Evergreen Media Corp. said Monday it had agreed to buy a dozen radio stations in five markets including Chicago, Philadelphia and Boston from Pyramid Communications Inc. for $306.5 million.

The deal would expand Evergreen's station lineup by more than a third to 34 overall, making the Irving, Texas-based company one of the nation's biggest radio station group owners.

Pyramid's stations in Boston and Philadelphia would give Evergreen representation in all 10 of the nation's top radio markets, potentially making the Evergreen station group more appealing to advertisers.

The deal is subject to regulatory approval, but is expected to close in early 1996.

Pyramid is selling three stations each in Boston, Charlotte, N.C., and Buffalo, two in Philadelphia and one in Chicago in the deal.

``The Pyramid stations are real jewels _ expertly managed and operated and leaders in their respective markets,'' Scott K. Ginsburg, chairman and chief executive of Evergreen Media, said in a statement.

Pyramid, based in Medford, Mass., is privately held by the investment firm Vestar Equity Partners of New York and company managers led by chief executive Richard Balsbaugh.

Evergreen said it would seek waivers from regulations on how many stations a single company may hold.

Federal Communications Commission regulations permit companies to own no more than 20 AM radio stations and 20 FM radio stations overall, and no more than two AM and two FM stations in any given market.

The purchase would leave Evergreen with 23 FM stations overall, five FM stations in Chicago and four FM stations in Charlotte. Evergreen recently obtained a temporary waiver to own four FM stations in Chicago.

Pyramid owns WXKS-FM, WJMN-FM and WXKS-AM in Boston; WHTT-FM, WSJZ-FM and WHTT-AM in Buffalo and WRFX-FM, WEDJ-FM and WRFX-AM in Charlotte. It also owns WYXR-FM and WJJZ-FM in Philadelphia and WNUA-FM in Chicago.