U.S. stocks finished slightly higher Tuesday as investors were cautious about taking new positions before the Thanksgiving holiday, while shares of aircraft maker Boeing Co. (BA) and Web search leader Google Inc. (GOOG) soared to record highs.

The Dow Jones industrial average rose 5.05 points, or 0.04 percent, to end at 12,321.59. The Standard & Poor's 500 Index gained 2.31 points, or 0.16 percent, to finish at 1,402.81. The Nasdaq Composite Index added 2.12 points, or 0.09 percent, to close at 2,454.84.

Click here to visit FOXBusiness.com's Investing Center.

A rise in crude oil prices back above $60 a barrel also weighed on the market in a light trading day, as higher energy costs prompted concern about the health of the U.S. economy and the mood of consumers before the start of the holiday shopping season.

Google shares tore through the key $500 level for the first time ever, climbing 3 percent to a record high at $510 and ranking among the Nasdaq's biggest gainers. Google ended at $509.65, up $14.60. In recent months, Google has pulled away from its peers on the Internet by posting sustained growth that is three to four times faster than its rivals. At the same time, its closest competitor, Yahoo Inc. is in turmoil over strategy.

In another sign of strength in the tech sector, shares of computer maker Dell Inc. (DELL) jumped 10 percent to $27.30 after the bell as the company posted better-than-expected third-quarter earnings. During regular trading, Dell shares rose 0.7 percent, or 17 cents, to $24.82 on the Nasdaq.

"Obviously, it is a holiday week so you'd expect things to be somewhat quiet, but the attention of many investors is probably focused on Google more than anything," said Hugh Johnson, chief investment officer of Johnson Illington Advisors in Albany, New York. "Oil is probably the most important economic factor today that is affecting the market, and it's clearly bad news."

U.S. crude oil for January delivery rose $1.37, or 2.3 percent, to settle at $60.17 a barrel on the New York Mercantile Exchange amid supply disruptions in Alaska and a rally in gasoline and heating oil futures.

The higher oil prices helped energy companies' shares, though, driving Exxon Mobil (XOM) up 1.3 percent, or 96 cents, to $73.39 on the NYSE. Exxon Mobil gave the biggest lift to the S&P 500 and was among the Dow's major gainers.

Investors have been betting that lower gasoline prices would propel consumer spending in the holiday shopping season, which traditionally kicks off on "Black Friday," the day after Thanksgiving.

"The principal factor that's been driving the market is the idea that the decline in the price of oil will more than offset the impact of deteriorating housing," Johnson said. "Every time you see the price of oil rise, it takes the gusto out of the market."

U.S. financial markets will be closed Thursday for Thanksgiving, and the stock market will close early on Friday.

Shares of Boeing rose 3 percent to a record high at $92.03 on the New York Stock Exchange and led the Dow higher after Korean Air Co. said it had placed an order for 25 aircraft. At the close, Boeing shares were up 2.2 percent, or $1.98, at $91.10 on the NYSE.

In another bullish sign for stocks, the Chicago Board Options Exchange Volatility index, or the VIX — known as the market fear gauge — hit a 12-year low, falling during the session to 9.84.

Strong earnings also propelled the market higher as major indexes finished just below their recent highs.

Shares of medical device maker Medtronic Inc. (MDT) shot up 9.4 percent, or $4.60, to $53.55 and were the second-biggest positive influence on the benchmark S&P 500 index, as the company posted a better-than-expected quarterly profit.

Shares of farm equipment maker Deere & Co. (DE) rose 6.6 percent, or $5.86, to $95.27, while the stock of upscale department store operator Nordstrom Inc. rose 4.5 percent, or $2.13, to $49.62 after the companies posted strong quarterly results.

Trading was moderate on the New York Stock Exchange, where about 1.53 billion shares changed hands, below last year's daily average of 1.61 billion. On the Nasdaq, about 1.72 billion shares traded, below last year's daily average of 1.80 billion.

On the NYSE, advancing shares beat decliners by about 8 to 5. On Nasdaq, advancing shares were about even with decliners, as 1,515 stocks rose and 1,497 shares fell.

Click here to visit FOXBusiness.com's Investing Center.