A feud between two Miami Beach hotel tycoons more than 20 years ago now looms as a key factor in a new area of environmental law - who owns the rights to the sun's rays.

Once mainly of interest to farmers and resort hotel owners, the question of "sun rights" - the name for this area of the law - is becoming increasingly important with emergence of solar energy as an alternative to gas, oil and coal for heating buildings.

What would happen, asked Gail Boyer Hayes of the Environmental Law Institute, if a neighbor planted a tall stand of handsome blue spruce trees that shaded your expensive new solar energy collection unit? Or if a new high rise blocked the sun's rays from every other solar collection unit on the block?

According to present law, nothing.

"Under current law," Hayes said, "you have no inherent right to receive sunshine even if you have an expensive solar collector."

Environmental lawyers are trying to develop a new theory of law granting a right to sunshine before any energy-related sun rights cases show up in the courts.

This has been "much harder than we anticipated," Hayes said, "but none of the potential legal problems to solar energy are insurmountable."

"We are going to have to develop a whole new type of rights, but every time you give one person a right it means taking it away from someone else," she said.

A prime example of this is the Miami Beach case, which Hayes blames "for most of the trouble we are having now."

As with many important legal matters, the case arose from a petty dispute - a feud between Ben Novack, owner of Miami Beach's fancy Fontainebleau Hotel, and his former partners in other hotel ventures, Harry and Sam Mufson, who had just built the smaller but equally fancy Eden Roc Hotel on adjoining beachfront property.

In what the Mufsons alleged was an act of "malice and ill will," according to court documents, Novack started construction near the property line of a 14-story addition to the Fontainebleau that blocked the sun from shining on the Eden Roc's pool for most of the afternoon.

The addition, court documents said, "cast a shadow of such size as to render the beach wholly unfitted for the use and enjoyment of it guests."

The Mufsons lost. The Florida Court of Appeals ruled that the Eden Roc had no right to the sun's rays - and the hotel was forced to build another pool and cabana area away from the shadow of the Fontainebleau's tower.

As far as American courts are concerned, the Miami Beach case apparently sounded the death knell for a pertinent doctrine in English common law.

That doctrine gives a continued right to sunlight to a person who has received from time immemorial, later defined by courts as 27 years, enough light to stand in the middle of a room "without grumbling" or to read a newspaper.

The Florida court found that "the English doctrine of 'ancient lights' has been unanimously repudiated in this country."

The legal issues now are far more serious than a hotel's financial survival or a sunbather's tan. The problem is to make it legally possible for people to harness the sun's energy rather than burn fossil fuels.

Legislation now before Congress would make the right to sunshine the same as the right to water in the western United States - basically a matter of first come, first served.

"Under that law, if someone puts up a solar-heated dog house in the middle of manhattan, the person who owns the lot to the south couldn't put anything that blocked the sunlight," Hayes said.

Nonetheless, that theory is popular with many lawyers, especially those specializing in water rights in the west, because legal precedent exists. But as the current fight about use of the Colorado River shows, the legal theory is cumbersome and often requires a series of court tests that enrich attorneys before anyone else benefits.

New Mexico, is the only state to have enacted sun rights legislation, and it is based on water rights laws.

While not entirely ruling out the possibility of copying some principles from water rights laws, the Environmental Law Institute group is leaning toward formation of a new legal theory based more on use of zoning and building codes.

"To avoid adding to the many poorly-conceived laws that already burden us, we suggest that any proposed solar access laws be subject to sharp scrutiny," the Environmental Law Institute team of Hayes, Alan S. Miller and Grant P. Thompson recommended in an earlier study funded by the Energy Research and Development Administration.

"Blanket solutions must not be imposed where a Band. Aid would do - and vice versa," Hayes said.

The new study, being done by the Environmental Law Institute and the American Bar Association Foundation with a grant from the Department of Housing and Urban Development, seeks to suggest a model sun rights code.

Other countries already respect the right to sunshine, and their courts enforce that right with hefty fines.

In Japan, for example, a court recently awarded a group of kindergarten children $4,500 because a new building blocked the sun from their school playground during the recess hour.