A brief but powerful thunderstorm ripped across the Washington area last night, inflicting its heaviest damage in Montgomery County, where almost 30,000 homes lost electric power, high winds toppled some houses under construction and lightning was blamed for at least four house fires.

No injuries were reported immediately as a result of the storm that brought winds of more than 50 miles an hour in advance of a cool front that, although weak, is expected to keep today's temperatures from reaching yesterday's record-setting level of 99 degrees.

Although storm damage was relatively minor in Fairfax County and other parts of Washington's Northern Virginia suburbs, Virginia Electric and Power Co. spokesmen said about 2,500 homes lost power for varying periods.

Maryland state police reported the collapse of part of the roof of a bowling alley in Brunswick, Md.

In Montgomery, builder Stanley Halle said frames of five town houses under construction in his Bronze Gate development on Colesville Road in Silver Spring were toppled by winds. He said damage may amount to more than $150,000. A National Weather Service official said houses under construction are particularly vulnerable to high winds.

Houses where county fire officials said lightning caused moderate to major fire damage included structures in the 10600 block of Norton Road in Potomac, the 10700 block of Lorain Avenue in Silver Spring, the 9600 block of Byeforde Road in Kensington and the 19800 block of Bramble Bush Drive in Gaithersburg.

Homes and neighborhoods where electricity was cut off were concentrated in the southern part of the county, a Potomac Electric Power Co. spokesman said. Some of the blackouts were caused by a fire in a substation in Silver Spring.

Yesterday's 99-degree temperature set a record for the date. It was the 41st day this year in which temperatures of 90 degrees or more were registered.