The Nobel Prize for physics was shared yesterday by two Americans and a Pakistani for their independent development of theories that help explain the behavior of the atom and why stars explode.

A third American, Purdue University professor Herbert G. Brown, 67 shared the Nobel Prize for chemistry with Georg Wittig, 82, a West German who taught at the University of Heidelberg until his retirement five years ago.

Brown and Wittig were honored for basic discoveries in the chemistry of boron and phosphorous, findings that made Brown a millionaire and put both men in the forefront of a race to develop new types of pesticides to which pests do not develop immunity.

Named winners of the physics prize were Sheldon L. Glashow and Steven Weinberg, both 46 and both Higgins professors of physics at Harvard University, and Abdus Salam, 53, a Pakistani who teaches at the International Center for Theoretical Physics in Trieste, Italy. The three share an award of $193,000.

Glashow and Weinberg reacted with surprise at news of the award.

"I think it's fantastic," said Glashow.

Weinberg said, "Of course I'm surprised . . . But it's a nice to start the week."

Salam, the first Pakistani to win a Nobel Prize, heard of the award in London and immediately went to a mosque to pray.

"My first reaction is the greatest gratitude to Allah," he said.

Besides sharing the physics prize, Glashow and Weinberg have much in common. Both are native New Yorkers, studied together as undergraduates at Cornell University and became professors at Harvard.

However, they shared the Nobel Prize for work they did six years and half a world apart. Glashow was cited for work at Copenhagen in 1961, Weinberg for achievements in 1967 at the Massachusetts Institute of Technology.

Basically, Glashow, Weinberg and Salam all wrote separate papers describing mathematical theories unifying two of the four fundamental forces in nature. They explained that electroagnetism and the weak nuclear forces that hold atoms together have a common structure.

"One talks now of the fundamental forces of nature as being gravity, strong nuclear force and something called electro-weak forces," Glashow said by telephone from Cambridge. "Before, people had spoken on electromagnetism, which is heat and electricity and magnetism, and weak nuclear forces as separate entities. Not any more."

In winning the chemistry prize, Purdue's Brown and Heidelberg's Wittig expressed the belief that they had won for a lifetime of work rather than any single theory or discovery. Brown said he has worked on boron chemistry for more than 40 years; Wittig has worked on phosphorus chemistry for 60 years.

"I began to explore the chemistry of borane [a mixture of hydrogen and boron] as a graduate student," Brown said by telephone from Linden, N.J., where he works as a part-time consultant for Exxon. "I've been working on boranes ever since."

Friends said Brown's work on boranes has earned him so many patents that he has become a millionaire.

Brown is the first member of the Purdue faculty to win a Nobel Prize, which will earn him half the $191,000 award. Born in a slum of Chicago, Brown is described as a man who loves to work and travel.

"I grew up very poor in a very rough section of central Chicago," Brown said. "I think that's why I'm on the move all the time."

Even at 82, Wittig still works in his private laboratory at his home in Heidelberg on the chemistry of phosphorous that won him a share in the Nobel Prize. Though hard of hearing, he spends his leisure time listening to the music of Tchaikovsky, Beethoven and Brahms.

Wittig advises young chemists "to never give up, always challenge the impossible," he told Washington Post Bonn correspondent Michael Getler.

"At my age, you don't expect honors or awards any more."

Physics winners Glashow and Weinberg were described by friends as "quite different" people, even though their love for physics took them into the same kind of work. Glashow was called an extrovert, Weinberg more reserved.

"Glashow is great in the lecture hall," one Harvard colleague said, "Weinberg gives a more thoughtful impression. Neither one is absentminded."

Though Weinberg was described as devoted to theoretical physics, he wrote a book called "The First Three Minutes" that won him two book awards in 1977. The book describes for the layman and the scholar the events that must have taken place during the first three minutes of creation.

The book has already sold 33,000 copies in the United States, was translated into 16 languages and has just been published as a paperback.

"That book took me 10 times longer to write than I thought it would," Weinberg said, "but it's been 10 times more fun and made me 10 times more money than I thought it would either."