The #90 that he wore with the Texans was worn by veteran defensive end Chris Kelsay in Buffalo. Williams started all 16 games in 2012, making 46 tackles, 10.5 sacks, and 2 forced fumbles. He had a season-high 3 sacks against the Colts on November 25, 2012. During the season, Williams was often bothered by a wrist injury which supposedly affected his play. On September 15, 2013, Williams had 4.5 sacks in a winning effort against the Carolina Panthers, which broke the Bills franchise record for the most sacks in a game. He finished the 2013 season with 38 tackles, a forced fumble, 4 passes defended, and 13 sacks in 16 starts. He finished the 2014 season with 42 total tackles (36 solo, 6 assisted), and 14.5 sacks. On January 2, 2015, he was named to the 2014 AP All-Pro First-Team, as well as the 2015 Pro Bowl. The Bills hired Rex Ryan as their head coach the next season, and Williams was outspoken in his disdain for the scheme Ryan installed, mainly complaining about how he did not want to drop back into coverage. His effort noticeably declined, and he registered only 5.0 sacks. On March 1, 2016, Williams was released by the Bills. On March 8, 2016, the Miami Dolphins signed Williams to a two-year, $17 million contract with $11.98 million guaranteed and a $4 million signing bonus. On February 16, 2017, after only one season with the team where he recorded just 1.5 sacks, Williams was released by the Dolphins. In 2010, Williams, an avid boater, commissioned a one-of-a-kind custom wrap on his MasterCraft X80 boat. Williams, Josh Sirlin and MasterCraft Boat Company worked out the details of the boat design through a series of sketches and then a life-size canvas painting. In 2011, Williams donated five Chevrolet Camaros to the Houston Police Department, and in 2013, he made another donation of five Dodge Chargers. In 2012, Williams debuted a honey-toasted oats breakfast cereal called "MariO's", and the proceeds from the sales are intended to be donated to a Buffalo charity supporting children with cancer and their families. Williams resided in Orchard Park, New York during his time with the Bills, where he bought a home for $2 million in 2012.