A rise in defensive sectors like pharmaceuticals pushed the Dow and S&P 500 higher on Friday, while technology shares dragged on the Nasdaq after National Semiconductor's disappointing outlook.

The healthcare sector rose as investors rotated money into defensive plays. The AMEX Pharmaceutical index <.DRG> gained 1.7 percent.

Defensive plays are stocks of companies that tend to weather the recession better than others because their products -- such as food or toothpaste or drugs -- are things that people buy, even if they cut spending, in leaner times.

Procter & Gamble Co
rose 1.1 percent to $52.58.

Chipmaker National Semiconductor Corp dropped 6 percent to $13.60 after posting quarterly results and an outlook that topped Wall Street's estimates, but the guidance fell short in comparison to an outlook earlier this week from fellow chipmaker Texas Instruments .

The PHLX semiconductor index <.SOXX>, slid 2.2 percent.

Some of the Nasdaq weakness is holding us back, said Frank Lesh, futures analyst and broker at FuturePath Trading LLC in Chicago.

The Reuters/University of Michigan Surveys of Consumers showed consumers' mood in June stood at its highest in nine months, but worries about inflation and labor market uncertainty persisted.

We are going to need to see some of this data come along with where we are in price, so until then, we are range bound until we get some data to support where we're trading at, Lesh added.

The Dow Jones industrial average <.DJI> gained 24.86 points, or 0.28 percent, to 8,795.78. The Standard & Poor's 500 Index <.SPX> edged up 0.55 of a point, or 0.06 percent, to 945.44. The Nasdaq Composite Index <.IXIC> dropped 7.55 points, or 0.41 percent, to 1,854.82.

(Editing by Jan Paschal)