GLENDALE, Ariz. — Relying on their defense for scoring sparks, the Ravens overcame an ugly showing on offense and held off the Arizona Cardinals 31-24 on Sunday at State Farm Stadium.

The Ravens, who improved to 6-2 with their third straight win, scored on their opening drive but needed interceptions from cornerback Brandon Stephens and safety Geno Stone to kick-start their next two touchdown marches. They also needed a late onside-kick recovery, after failing to grasp one late in the fourth quarter, to put away the game and end a Cardinals rally.

A week after dominating the Detroit Lions, the Ravens struggled to stay in gear against a statistically unimpressive Cardinals defense, finishing with just 268 yards. Quarterback Lamar Jackson went 18-for-27 for 157 yards and a touchdown, and the Ravens converted just four of their 11 third downs.

The Ravens’ most reliable weapon was running back Gus Edwards, who rushed 19 times for 80 yards and three touchdowns, quieting some of the chatter about the offense’s need for an impact running back at the trade deadline.

The Baltimore Banner thanks its sponsors. Become one.

Ravens running back Gus Edwards had 80 yards and three touchdowns on 19 carries. (Christian Petersen/Getty Images)

His second score gave the Ravens a 21-7 lead near the end of the third quarter, capping a three-play, 23-yard drive set up by Stone’s NFL-high fifth interception. Edwards also scored just before halftime, helped by Stephens’ interception in Cardinals territory.

After a shaky start, the Ravens’ defense stifled Arizona (1-7) for much of the afternoon. Quarterback Joshua Dobbs went 25-for-37 for 208 yards, two touchdowns and the two picks. The run defense stiffened in the second half, finishing with 129 yards allowed (4 per carry).

Running back Justice Hill and tight end Mark Andrews led the Ravens with 40 receiving yards apiece. Andrews, a native of nearby Scottsdale, answered the Cardinals’ opening-drive score with a 5-yard touchdown late in the first quarter.

A good day to be bad?

The Ravens sure know how to pick their spots. Last week, they saved their best game of the season for maybe the best team they’ve faced all season, routing the Detroit Lions from start to finish. This week, they saved one of their worst performances of the season — 4.6 yards per play on offense, three touchdowns allowed on defense — for probably the worst team on their schedule.

There’s a skill to winning ugly, and perhaps it was unreasonable to expect another butt-kicking so soon after last week’s. But the Ravens couldn’t get much going against a dreadful Cardinals defense, nor could they offer much red-zone resistance against a backup quarterback surrounded by few brand-name weapons. Their special teams execution wasn’t great, either.

The Baltimore Banner thanks its sponsors. Become one.

— Jonas Shaffer, beat reporter

Consistently inconsistent

How long can the Ravens keep winning this way? Yes, they’ve shown up for some big games, downing the Cleveland Browns and the Detroit Lions, but then they play down to their other opponents. And, in this case, they played down to one of the worst teams in the league. I’d say they were conserving energy for big games by squeaking out wins against lesser opponents, except they dropped two games to the Steelers and the Colts.

Against the Cardinals, none of the Ravens’ first three touchdown drives was generated by offensive excellence. The first came after the Cardinals committed pass interference in the end zone to give the Ravens a fresh set of downs. The second and third were both gifts from the defense after Brandon Stephens and Geno Stone interceptions. Although clutch, the defense was leaky. The punt team, led by Jordan Stout, felt like the most solid unit out there for the majority of the game.

– Giana Han, beat reporter

Pulling punches in a win

There are two kinds of Ravens wins this season, and this one looked a lot like the one Baltimore got over the Titans rather than the one against the Lions last week. Perhaps the Ravens held some cards back for the Cardinals. The QB-designed run game wasn’t a huge factor. If Todd Monken hoped to skate without putting Lamar Jackson too much at risk, I suppose mission accomplished. The run game was slow starting, but Gus Edwards’ pile-pushing runs were huge (and a notable counter to Derrick Henry trade rumors circling).

The Baltimore Banner thanks its sponsors. Become one.

On defense, the Ravens should give the game ball to Joshua Dobbs. Two really bad throws were the key to this unit coming out reasonably clean. Aside from Michael Pierce’s strong game, Baltimore wasn’t particularly dominant against a banged-up Cardinals attack. It’ll do for this week, but this game felt pedestrian compared to the soaring highs against Detroit.

– Kyle Goon, columnist

There’s value in finding a way

The Ravens must have wanted to quickly squash all suggestions they’re a Super Bowl favorite. Or maybe they’re just going to spend all season playing down to lesser opponents. Or perhaps it’s nothing mystical like that. The offense sputtered a bit and never got going; the defense needed a few turnovers (on unforced errors) to get by.

But I don’t think this game created any new reasons to be concerned about this team. It is inconsistent. It lacks game-changing talent beyond Lamar Jackson and Roquan Smith. But the Ravens are well coached and have few glaring weaknesses. It’s a good formula — and getting wins like this is important with the Bengals looking more like themselves Sunday. Sometimes in the NFL, even against one-win teams, you have to survive and advance.

– Chris Korman, editor

The Baltimore Banner thanks its sponsors. Become one.

This story was updated to reflect Gus Edwards’ touchdown total.