SAN FRANCISCO -- At least the 49ers have been consistent on offense this season.
For the fourth time in five games, the 49ers failed to gain 200 yards Sunday on their way to a 9-7 loss to the Baltimore Ravens.
San Francisco finished with a season-low 163 yards under backup quarterback Trent Dilfer with 65 coming on back-to-back plays in the third quarter. Other than the 42-yard pass to Bryan Gilmore, followed by the 23-yard touchdown throw to Arnaz Battle, San Francisco's offense struggled to gain yards.
"It's frustrating in any walk of life when you're not doing as well as you want to," Dilfer said. "It's no different than anything else. You invest so much into this thing. I don't have one complaint about anybody in this organization about how they approach this thing. It's just not happening on Sundays, and that's very frustrating."
San Francisco opened the season by gaining 194 yards in a 20-17 victory over Arizona with most of the offense coming on a game-winning drive orchestrated by Alex Smith in the final minutes.
The 49ers followed with 186 yards in a 17-16 victory over St. Louis that was sealed when Jeff Wilkins missed a 56-yard field-goal attempt in the final seconds.
They were held to 184 yards in last week's 23-3 loss to Seattle when Smith sustained a separated shoulder after three plays. But despite the struggles Sunday, San Francisco had a chance. But Joe Nedney missed a 52-yard field-goal attempt wide right with 2:44 to go, and the Ravens ran out the clock.
"Joe is an outstanding kicker," coach Mike Nolan said. "I would trust the game in his hands anytime. He just didn't come through (Sunday)."
The strategy against the Ravens' tough defense was to protect the ball, keep the game close and hope to steal it at the end. It almost paid off.
"Nobody admires the mentality of defense they play more than I do," said Dilfer, who was the quarterback when the Ravens won the Super Bowl following the 2000 season. "It is second to none.
"There's an attitude there, a belief system, a set of core values defensively that makes it very difficult to play good offensive football against them. I kind of had to go back to my Baltimore days, my Tampa Bay days, where it was don't make mistakes, keep us in the game, and trust your defense and kicking game."
Dilfer finished 12 for 19 for 126 yards with one touchdown and one interception. But he was much better in the second half, completing 10 of 13 passes for 118 yards.
"The first half was rough," Dilfer said. "We had no offensive rhythm. We didn't have enough plays. Once we got going in the second half, it felt more like football again."
San Francisco had a conservative game plan from the start, calling runs on third and long and dumping off passes to avoid the rush. Even trick plays didn't work. On third and 2 late in the third quarter, coordinator Jim Hostler called for a direct snap to running back Frank Gore, who gave it to Gilmore on a reverse that lost 8 yards.
The play-calling and performance didn't go over well with the fans, who began booing almost from the start.
"That's been the story of my life," Dilfer said. "That's fine. If I was up there and I was as frustrated as they probably are, I'd probably boo, too."
The 49ers have been held under 200 yards 39 times since the NFL-AFL merger in 1970 with 13 of those coming in Nolan's 37 games as coach. With the timing of Smith's return still in doubt, for now it's up to Dilfer to fix things, starting in the upcoming bye week.
"I don't know what the issues are exactly on offense, but we have a lot of work to do," Nolan said.
Leading by two points in the fourth quarter, the Ravens were able to hold onto the ball for 8:26 on one drive and then run out the clock after Joe Nedney's missed field goal with 2:37 left.
"We look at it in the sense that we need to do anything to get the win," defensive lineman Marquise Douglas said. "Maybe if we gave our offense a couple of more shots today, then we might have been able to win the game. Nobody is in here holding their head up high and saying that we did our jobs."
Coordinator Mike Singletary agreed there is plenty of work to do, pointing to the injuries Baltimore had. Pro Bowl tackle Jonathan Ogden and star tight end Todd Heap missed the game because of injuries. When Adam Terry and Mike Flynn left during the game, Baltimore only had one lineman playing his regular position.
"The team we played, let's be honest, had a lot of people hurt," Singletary said. "We weren't playing the Baltimore Ravens' offense. We did a decent job, but we have to do better."
Lee's first punt went 45 yards before being downed at the 1 by Shawntae Spencer.
"All I had to do was stop the ball," Spencer said. "I give all of the credit to Andy Lee. He's been doing a great job for us all season."
San Francisco didn't take advantage of the field position as Steve McNair completed an 11-yard pass to Willis McGahee on the first play. The 49ers eventually forced a punt and took over on their 34 before going three-and-out.
Later in the quarter, Lee drilled a punt that rookie Yamon Figurs lost in the sun. The ball bounced all the way to the Baltimore 2 for a 74-yard punt.
The Ravens got out of that hole when Spencer was called for a questionable pass interference penalty on a third-and-8 pass from the 4.
Lee added a 64-yarder in the fourth quarter when Ed Reed let the ball bounce and die at the 17.
Lee has been outstanding all season, averaging 50.1 yards with 11 of his 36 kicks ending inside the 20.