Updated

Tim Tebow took the snap, put the ball in Willis McGahee's belly and decided whether to hand it off or keep it for his own run.

Those plays looked a lot like what he did so often in college — especially the results.

Tebow threw two TD passes and ran for 117 yards, McGahee added 163 yards rushing and two more scores and the Denver Broncos beat the Oakland Raiders 38-24 Sunday.

Even though he looked far from a prototypical NFL quarterback relying on his legs much more than his arm, Tebow still managed to win for the second time in three starts this season and put the Broncos (3-5) one game out of first place in the AFC West.

"Honestly it doesn't necessarily matter too much how you drew it up as long as you get this feeling at the end, because it was pretty special," he said.

It's quite a turnaround from a week ago, when Denver was dismantled 45-10 by Detroit and some of the Lions were questioning Tebow's ability to succeed in the NFL. Broncos coach John Fox was only willing to commit to Tebow for this week's game. But after the coaches made a few tweaks to the offense, Tebow earned himself another start.

He threw touchdown passes to Eric Decker and Eddie Royal early in the game and then expertly ran the option game that helped the Broncos gain 298 yards on the ground, their highest total since a 300-yard game against Seattle in 2000, and most ever against the Raiders (4-4).

"As long as it worked, that's all I care about," McGahee said. "He did a great job as far as reading the ends on what he had to do as far as keeping it or giving it. When I got the ball it was my job just to get some yards."

McGahee had a 60-yard touchdown run that tied the game on the first play after Carson Palmer threw his second interception for the Raiders, then added a 24-yarder to ice it in the closing minutes. Denver took the lead in between those big runs when Royal returned his first punt of the season 85 yards for a touchdown.

Tebow finished 10 for 21 for 124 yards, but took only one sack after taking 13 in his first two starts.

"I thought he improved throwing the ball," Fox said. "I think he's always run the ball pretty effectively. He's very competitive by nature. You see evidence of that. Now it's just learning how to be an NFL quarterback. In my opinion he's gotten better each time out."

Palmer looked much better in his first start with the Raiders than in his debut two weeks ago in a relief effort against Kansas City. Then, he threw three second-half interceptions, including one returned for a touchdown in a 28-0 loss five days after he joined the team.

With a bye week and this past week to get acclimated to his new team, Palmer showed why Oakland dealt a 2012 first-round draft pick and a conditional 2013 second-rounder to Cincinnati to acquire Palmer after starter Jason Campbell broke his collarbone.

Palmer was 18 for 34 for 312 yards with three touchdowns. But he threw three more interceptions, including one that provided a sudden change of momentum in the closing seconds of the third quarter.

"It's kind of a crash course the last couple weeks," Palmer said. "It's like you're jamming or cramming for a final or a test. But I just got to continue to work, continue to study, continue to have it down and learn from every opportunity I get."

With the Raiders in Denver territory, Palmer threw high to Denarius Moore and Chris Harris intercepted the deflected ball. McGahee then ran through a big hole up the middle and outraced the Oakland defense for a 60-yard score. It tied the game on his longest run since a 77-yarder in Oakland in the 2009 season finale for Baltimore.

Tebow did little in the first half besides two big plays on one drive. First he ran 32 yards on an option keeper when former teammate Jarvis Moss bit on a fake.

"We knew exactly what they were going to do and we just didn't stop it," Raiders defensive tackle Richard Seymour said. "We knew exactly what was going to happen, and they ran exactly what we thought they were going to run and we didn't get the job done. That's the disappointing part."

Tebow then hit Decker on a 27-yard touchdown pass to make it 7-3. Tebow missed his share of open receivers but didn't miss Decker, who badly beat Michael Huff on a post route.

The Raiders capitalized on a botched punt to regain the lead. Britton Colquitt couldn't handle the low snap from Lonie Paxton and threw the ball away to avoid a sack in the end zone. That gave the Raiders a first down at the Denver 14 and Palmer found Michael Bush on an 11-yard score for his first TD with the Raiders.

Palmer bounced back from an interception later in the second quarter with his best pass as a Raider, threading a 40-yard touchdown pass to fullback Marcel Reece.

The Broncos missed a chance at three points at the end of the half when Fox too a field goal off the board to accept a roughing the kicker penalty on Taiwan Jones. Matt Prater then missed a 43-yarder at the end of the half.

Notes: The only other Broncos QB to rush for at least 100 yards in a game was Norris Weese with 120 in 1976 against Chicago. ... Denver DE Elvis Dumervil had his first sack since Dec. 27, 2009. He missed all last season with an injury. ... Raiders MLB Rolando McClain dressed but did not play with a sprained left ankle. ... Broncos S Rahim Moore left with a concussion after the first play from scrimmage.