Pennsylvania Republicans tonight gave George Bush the mandate he sought to continue his challenge to Ronald Reagan's nomination by staking the GOP challenger to a victory over the conservative favorite in their first head-to-head test of the year.

Bush rode a million-dollar media campaign to a desperately needed win over the front-runner in Pennsylvania's nonbinding preference poll. Reagan, however, was expected to pick up about 50 of the 77 technically uncommitted district delegates elected separately today, to add to the collection that has brought him more than halfway to nomination.

But for Bush, who had won only three of the 14 previous primaries, compared with Reagan's 11, tonight's victory was vital to sustain his admittedly underdog effort to derail the Reagan bandwagon.

With 73 percent of the precincts reporting, Bush had 54 percent of the vote, Reagan 45 percent, and Rep. John B. Anderson, who was a write-in, 2 percent.

Bush told several hundred supporters in Houston he was "very, very pleased" with the win and said, "we're going to keep hammering at the key issues" and "the sometimes contradictory ideas of our opponent."

Reagan, campaigning in Lafayette, Ind., countered with his first flat-out prediction of a victory at the GOP convention in Detroit, telling reporters, "I believe I'm going to win the nomination."

In an eight-paragraph formal statement, which made no mention of Bush, Reagan said his "major objective" in Pennsylvania had been winning a majority of the delegates -- and that was achieved.

He said his "conservative estimate" ws that he has won "or can reasonably count on winning" in states yet to vote "nine-tenths of the delegates needed for nomination."

While there was no great gloom in the Reagan camp, aides conceded they had hoped for a victory in Pennsylvania that would shut down Bush's challenge and leave Reagan unencumbered by opposition as he prepared for the convention and the general election campaign.

Instead, he must continue to wage a fight for the remaining opponent with a bigger bankroll at his disposal.

James A. Baker III, Bush's campaign manager, said in Houston tonight that Bush has about 04 million to spend before bumping the legal ceiling, while Reagan has perhaps only 40 to 50 percent of that amount available for the remaining primaries and convention.

Analysis of the voting patterns showed that Bush had consolidated support from moderate and liberal Republicans -- in part because Illinois Rep. John B. Anderson, the liberal Republican who is about to bow out of the GOP race to become an independent candidate for president, was not on the Pennsylvania ballot.

Bush blamed Anderson and the crossover vote for his failure to defeat Reagan in Illinois and Wisconsin -- two previous primaries on which he had staked great hopes.

But interviews with voters leaving the Pennsylvania polls by The Washington Post and ABC news also showed Bush had come close for the first time to breaking even with Reagan among self-described conservatives.

The challenger had concentrated his Pennsylvania campaigning on what he called the failures of President Carter's foreign and economic policies and the inadequacy of Reagan's proposed remedies -- presenting himself as a "responsible" alternative to both.

Those themes, hammered home in a saturation television campaign, apparently had a real effect in Pennsylvania, despite Reagan's ability to produce in the final day before the voting a series of big-name endorsements from moderate Republicans who said he had cinched the nomination.

The ABC News poll showed Bush beat Reagan by 2 to 1 among Republicans who decided their vote in the last week.It showed he gained wide support among those who said experience in government, the ability to handle foreign policy and inflation were most important in their voting decision.

There were other encouraging signs for the challenger in the polling. Among Republicans answering the ABC survey, 27 percent said Reagan was unacceptable as president, while only 12 percent found Bush unsuitable for the White House.

Among Democratic voters in this non-crossover state 33 percent said they would have supported Bush if they had voted in the Republican contest, and only 16 percent said they would have backed Reagan.

But for all the positive signs, Bush still faces an uphill struggle to catch Reagan, a man he called "a formidable opponent." The front-runner came into Pennsylvania with 547 of the 998 delegates needed for nomination, while Bush had only 96. Anderson had 56 and another 74 were uncommitted or scattered.

Reagan said in a statement issued in Lafayette, Ind., that his "conservative estimate" is that he has won "or can reasonably count on winning nine-tenths of the delegates needed for nomination."

The battle between Bush and Reagan now shifts to Texas, starting with a television debate Wednesday night in Houston. Reagan is a solid favorite in the May 3 Texas primary, and Bush aides said he would contest seriously in only half a dozen districts in the state where he has lived most of the last 25 years.

But Bush will make major efforts in later May primaries in the District of Columbia, Maryland, Michigan and Oregon and on June 13 in Ohio and New Jersey.

He said in Philadelphia this morning that he thought the Pennsylvania results would show he was "doing a better job of spelling out my differences" with Reagan, adding, "I think people are beginning to get it in focus."

Reagan got an early and important advantage in the battle for Pennsylvania last June, when he received the backing of the state's Republican national committeeman, Drew Lewis, and his political partner, Rick Robb. In 1976, Lewis and Robb held all but 10 of the Pennsylvania delegates for President Ford, even when Reagan tried to crack the delegation by naming Sen. Richard S. Schweiker of Pennsylvania as his choice for vice president.

Lewis and Robb focused first on the delegate contest, seeking to obtain endorsements for Reagan from locally popular delegate-candidates and from organizations, such as the Delaware County GOP, capable of delivering a vote.

Because ballot position has been important historically in the election of delegates, Reagan strategists filed as many delegate candidates as possible, hoping for top-line positions. In the western Pennsylvania 21st District, for example, Reagan supporters gained seven of the top eight ballot positions. f

In this fashion, Reagan virtually guaranteed himself at least 35 district delegates. With Schweiker and Lewis on the at-large slate already named by party leaders, that gave him a core of 31. Then, in the culmination of negotiations begun by John P. Sears before his ouster in February as Reagan's national campaign manager, Philadelphia Republican leader William (Billy) Meehan committed his 13 delegates to Reagan, bringing the Californian's probable bloc to at least 50 of the 83 delegates.

Bush was able to attract the support of several influential local Republican leaders, but his hopes for endorsement from Gov. Dick Thornburgh and Lt. Gov. William W. Scranton III went unfulfilled as they chose to remain neutral in the face of Reagan's growing support inside and outside the state.

A poll taken for the Bush campaign at the time of the April 1 Wisconsin primary showed him trailing Reagan by 30 percentage points, with many of those surveyed saying they knew little about the former congressman, ambassador, CIA director and national party chairman.

But with three weeks to campaign and an ample financial warchest, Bush decided to make an all-out effort to overtake Reagan in the "beauty contest," believing a victory there would keep his campaign alive, even if it did not reduce Reagan's bag of delegates.

The opportunity was made more attractive by the fact that Anderson was not on the preference ballot. The Illinois representative's local supporters failed to collect the 1,000 signatures needed by January to gain a place on the ballot.

So Bush spent 14 days campaigning here and poured about $1 million into a media-oriented campaign that brought dramatic increases in his name recognition and measurable gains in support. Bush's telephone canvassers found sharp jumps in support in media markets where he did his live half-hour televised prime-time "Ask George Bush" town meetings, and the campaign reran the programs more than 20 times in an effort to sustain those gains.

Reagan moved in the last five days to counter the Bush blitz with a wave of endorsements by moderate Republicans in neighboring states, all of whom said, in one way or another, that Reagan had earned the nomination by his earlier primary victories and this was the time for moderates to unite behind the conservative champion.

The message came, on succeeding days, from the hierarchy of the New Jersey and New York GOP, from 36 House members, and from the governors of Delaware and Ohio.

When Reagan returned to Pennsylvania Sunday evening for his final round of appearances, he was endorsed -- and joined -- by Senate Republican leader Howard H. Baker Jr. of Tennessee, who had vied with Bush for moderate Republican support in the early primaries but passed over Bush to throw his backing to Reagan.