In a high-spirited tribute to solar power, more than 20,000 Washington residents joined Americans across the nation yesterday to celebrate Sun Day with foot races, yoga, prayers, hot-air balloons, songs, speeches and some controversy.

At the Lincoln Memorial, nearly 500 solar energy advocates - many of them huddled in blankets and shivering in the cold - watched and listened to flute music at 6:08 a.m. as the sun rose in a cloudless sky. More than 120 joggers later joined in what was termed a "sun run" around the Mall. And thousands of others, including many high school students, gathered on the Washington Monument grounds to toss Frisbees, hear speeches and listen to music.

Two solar-minded congressmen, Rep. Richard L. Ottinger (D-N.Y.) and Rep. James Jeffords (R-Vt.), led hundreds of hikers to the 1,500-foot summit of Cadillac Mountain in Maine's Acadia National Park, one of the first points where sunlight normally strikes the United States in the morning. The Maine sky, however, was cloudy yesterday.

America's United Nations ambassador, Andrew Young, andactor Robert Redford addressed a solar energy rally outside U.N. headquarters in New York. Young took the occasion to compare the Sun Day celebrations of the 1960s. In Detroit, the United Auto Workers helped organize a lunch-time Sun Day rally that drew an estimated 4,000 persons.

President Carter commemorated Sun Day with a symbolic gesture and one apparently significant announcement, as he flew to Golden, Colo., the site of the natlon's new Solar Energy Research Institute.

Carter announced he has ordered a new cabinet-level review intended to map a national solar energy strategy. Such a step had been expected and is regarded as helpful by some of the organizers of the Sun Day extravaganza. Carter's symbolic gesture was an announcement that a solar water-heating system would be installed in the White House.

The Carter administration has been under increasing attack from advocates of solar energy, including leaders of Sun Day. They have accused the administration of neglecting solar energy and focusing, instead, on coal and nuclear power. This charge was repeated throughout the day yesterday in a number of speeches.

Sun Day, a sequel to Earth Day, had been designed by its organizers - a coalition of environmentalists, consumer advocates, labor unions and others - to heighten public awareness of sola*r energy's potentially wide-spread uses and to put pressure on the federal government to invest more heavily in solar energy projects.

Earth Day, which took place April 22, 1970, was a similar celebration of environmental goals and has been widely described ass a factor in the ultimate enactment of antipollution legislation, the creation of new government agencies and policies and the increase in concern among Americans about conservation.

Richard Munson, one of the coordinators of Sun Day, said in an interview last night that the Sun Day coalition appeared to have achieved its initial aims. "Out of what we've accomplished, we can make people recognize that there's a constituency for this thing," he said. "We have to make people realize that this thing can work.

While yesterday's efforts to promote solar energy and the numerous Sun Day exhibits of solar-powered equipment clearly had an impact in some participants in the celebration, it remains uncertain whether they will increase America's reliance on solar energy in the near future. It also was unclear how many Americans actually took part in Sun Day doings. Munson claimed that 30 million to 35 million persons participated throughout the country.

In Washington, the number of residents who joined in the Sun Day celebration appeared to have substantially exceeded the number that took part in Earth Day eight years ago. Only about 5,000 persons were estimated in 1970 to have participated in Washington's Earth Day rallies and demonstrations. Earth Day drew far larger crowds elsewhere in the country.

While Sun Day took place for the most part in a lighthearted and leisurely atmosphere, a number of conflicting political notes were sounded in speeches here and elsewhere, as politicians and environmentalists poaid homage to their vision of solar energy's promise.

"We're going to bring this (Carter) administration into the solar age, kicking and screaming, whether they like it or not," Rep. Ottinger said in a Sun Day speech on the Washington Monument grounds. Ottinger has flown here from Maine, after a mid-morning stopover in New York for another Sun Day talk.

Rep. Mike McCormack (D-Wash.), chairman of the House subcommitee on advanced energy technologies, expressed a far more cautious view as he joined in a ceremony to dedicate a $300,000 solar water-heating system at Hogate's Restaurant on the Washington waterfront.

"In spite of its advantages, solar energy has very real limits," McCormack said. "It can't possibly relieve our heavy reliance on clean coal and nuclear to fill our energy needs to the end of the century."

Despite such political attacks and warnings, Sun Day proved to be mainly an exuberant outing for thousands of Washingtonians. Government workers spent their lunch hours sitting in the brilliant sunshine on the Washington Monument grounds, which had been transformed into an enormous sundial for the occasion.

Students skipped school. Tourists and others wandered through exhibits that ranged from an irrigation pump operating on solar-generated electricity to a solar-powered hotdog cooker.

Some. like William W. Walsh, had practical reasons for taking part in Sun Day. Walsh, a retired Army Corps of Engineers major, is remodeling his home near Lorton and said he plans to install solar heating equipment. Sun Day, he said, provided him with an opportunity to talk about solar heating systems with manufacturers who set up exhibits near the Monument grounds.

A few, like Steven Kopstein, came to protest. Kopstein, a Montgomery County high school student, carried a placard that said, "Turn off the Nukes - Turn on the Sun." "My mother gave me permission to come down here (because Sun Day is) educational," said Kopstein, who had skipped school for the celebration.

Others, like Betty Lee Ford and Betty Thompson, viewed Sun Day simply as a pleasant outing. Ford and Thompson, both auditor sat the Internal Revenue Service, sat on the lawn near the Washington Monument, picnicking on sandwiches during their lunch hour. "We came to hear blue grass," said Thompson. "Beautiful day, too," added Ford.

Throughout the Washington area, there were exhibits and other doings to mark Sun Day. In Montgomery County, several hundred schoolchildren attended the official opening of a solar-heated school house. The building was constructed entirely by schoolchildren and is intended to help teach other students about solar heating.

Not all went according to plan. A solar energy exhibition scheduled to open at Great Falls National Park in Virginia was postponed until Saturday because, officials said, part of the exhibit had not yet arrived.

Sun Day, nonetheless, proved inspirational for some. Mr. and Mrs. Morris Berger, tourists from Miame Beach, Fla., watched films on solar energy at the Smithsonian Institution's Natural History Museum. "It gave us faith that our children will have these things," said Mrs. Berger, who is 73. It is good to know that."