It wasn’t always pretty, but the Buffalo Bills kept their faint playoff hopes alive with a 19-14 win over the Miami Dolphins on Thursday night. For the first time all season, the Bills were led by their defense -- which finally came through with a solid performance.

Offense: C

Much like Buffalo’s Week 9 loss to the Houston Texans, the Bills were able to move the ball on offense at times but struggled badly in the red zone. The Bills were 0 for 4 inside the Dolphins' 20, which nearly came back to haunt them at the end of the game. RB C.J. Spiller (22 rushes for 91 yards) was Buffalo’s best offensive weapon and could have used a few more touches. QB Ryan Fitzpatrick (17 of 27, 168 yards) had a decent night and wasn’t helped by a drop in the end zone from WR Donald Jones (it would have been a difficult catch, but it was a well thrown ball). Previous game’s grade: B+

Defense: A

This was the type of performance the Bills were expecting from their defense when they gave DE Mario Williams a $100 million contract in free agency and drafted CB Stephon Gilmore in the first round of the draft. The unit swarmed to the ball in the running game, holding the Dolphins to 60 yards on the ground (Miami Reggie Bush had only 20 yards on 10 carries). The Bills were 32nd against the run leading into the game, though that number is bound to change following this performance. Williams, DE Shawne Merriman and DE Kyle Moore all had sacks. The Bills had two big plays on the back end, as well -- late interceptions from FS Jairus Byrd and LB Bryan Scott were pivotal in keeping the Bills on top. Previous game’s grade: D

Special teams: B

Leodis McKelvin gave the Bills a huge boost of adrenaline with a 79-yard punt return on the fourth play of the game. McKelvin has been sensational this season on special teams and is the first Bill in team history to have two punt returns for TDs in a season. He has five returns for touchdowns in his career (three punt returns, one kick return and one INT return). The Bills received a taste of their own medicine later in the first quarter when Miami's Marcus Thigpen returned a kickoff 96 yards for a score. On the play, linebackers Nigel Bradham and Chris White were sealed off to create a large hole. K Rian Lindell connected on all four of his field goal attempts. Previous game’s grade: C-

Coaching: B-

The defense finally started to live up to its offseason hype, which takes defensive coordinator Dave Wannstedt off the hot seat for a few days at least. Some of Chan Gailey’s play calls on offense were a bit perplexing. Gailey continues to force the wildcat at inopportune times, and whether it’s Brad Smith or Tashard Choice, the wildcat never seems to work for the Bills. Gailey also took Spiller off the field in several key situations for Choice and it backfired on almost every occasion. Spiller had averaged over seven yards per carry heading into the game. Why not ride the hot hand while it lasts? The Bills sometimes out-think themselves on offense, but they were able to get away with it against an average Miami team. Previous week’s grade: B

For more updates on the Bills, follow correspondent Mark Ludwiczak on Twitter @CBSBills and @MarkLud12.