Joe Ferguson exploited the glaring weaknesses in Miami's secondary tonight to make it easy for Buffalo to roll over the floundering Dolphins, 31-21, and tighten the AFC East Division race.

Ferguson completed 20 of 29 passes for 338 yards and three touchdowns to help boost the Bills' record to 42, a half-game behind the Dolphins, now 4-1-1 with the Redskins coming up Sunday in Miami.

"I didn't expect to be this successful against the Dolphins," Ferguson said. "I thought they would have a stronger pass rush, but we did a great job of picking up their stunts.

"If a quarterback has the kind of protection I did tonight, he should be able to get the ball to his receivers. A lot of time, we just had the right play called at the right time for the coverage they were in."

Coach Don Shula had said before the game he was upset with the way his team had been playing pass defense and, it turned out, his concern was justified.

"Our defense never made a play all night long," he said in an obvious overstatement, because the Bills were held scoreless after building up a 31-7 halftime cushion. "I'm very upset the way we're playing defense these days."

Although the Dolphins came into the game unbeaten, Shula was quick to point out that his team had given up 28 points in Baltimore and 28 to the New York Jets in the last two games.

"This was about as bad as you can get beaten," Shula said. "The way we were handled in the first half, this was as sad a first half as we have had in a long time.

"Ferguson had a great night," he continued. "He and his receivers played super. The offensive line protected him well last season and are doing an even better job this year."

Ferguson's passing yardage was the third best in his nine-year career and his three touchdown passes brought his season's total to 14, tying him with San Diego's Dan Fouts for the league lead.

The expected battle between the top teams in the AFC East turned into a mismatch when Buffalo scored three touchdowns in 3 minutes 7 seconds just before halftime.

The Dolphins had dug themselves a hole on the opening kickoff when rookie defensive back-kick returner Fulton Walker fumbled and the ball went out of bounds on his four.

Three downs later, the Bills had an opportunity for great field position, but were detected holding on the punt return and had to start from their 41. Another holding penalty pushed them back to their 37, but Ferguson threw to Jerry Butler for a 13-yard gain to midfield.

Ferguson, getting excellent protection, found tight end Mark Brammer open over the middle for a 19-yard gain to the 27. Ferguson was on target again, hitting tight end Buster Barnett for seven yards, but Ron Jessie dropped a third-down pass and the Bills had to settle for Nick Mike-Mayer's 37-yard field goal.

After an exchange of punts, linebacker Isiah Robertson set up Buffalo's first touchdown by intercepting Miami quarterback Don Strock's pass into the flat and running 15 yards to the Miami 28.

It took Ferguson just one play to ring up six points. He passed over the middle to Butler, who cut in front of Walker, split the secondary and raced in untouched. Mike-Mayer's conversion made it 10-0 with 1:14 left in the first quarter.

On Buffalo's next possession, Ferguson engineered an 80-yard drive that took 13 plays and 8:11 before Roosevelt Leaks spun over left guard for the final yard. The big plays were a 21-yard pass from Ferguson to Jessie and a 29-yarder to Frank Lewis, who was wide open in the middle of the Miami secondary.

Walker atoned for his earlier miscue and put the Dolphins on the scoreboard when he took the ensuing kickoff and raced 90 yards for a touchdown. The 193-pounder from West Virginia broke through a mass of defenders around the 30, stepped out of a low, half-tackle by Mike-Mayer, then cut to the sideline and cut the Bills' lead to 17-7.

Ferguson wasn't about to let the momentum shift, however. Before the sellout crowd of 80,020 had stopped buzzing, the nine-year veteran from Arkansas fired a quick pass over the middle, where the Dolphins had been so vulnerable. Joe Cribbs grabbed it, ran right past free safety Don Bessillieu, cut to the sideline and outran linebacker Ernie Rhone to the end zone.

Buffalo kept up the pressure on Miami's first play after that touchdown when linebacker Shane Nelson stepped in front of Nat Moore and intercepted Strock's pass. He returned the ball back nine yards to the Dolphins' 39 and it took Buffalo just three plays to score.

After Lawrence McCutcheon gained three yards up the middle, Ferguson connected with Lewis for an 11-yard gain to the 25. Following a conference with Coach Chuck Knox at the two-minute warning, Ferguson again exploited the Dolphins' weaknesses deep in the middle. Butler flanked to the left, then cut to the middle and hauled in Ferguson's pass under the goal posts to boost the Bills' lead to 31-7.

Ferguson completed 11 of 15 passes for 221 yards and three touchdowns that half.