Palmer was signed Tuesday, two days after being cut by the Chicago Bears, where he lost the backup competition to Jimmy Clausen.
In five NFL seasons, Palmer has appeared in just four games and completed 10 of 15 passes for 59 yards and two interceptions.
Lewis' release comes as a surprise after he went 2-3 last year while filling in for injured rookie starter EJ Manuel.
Acquired in a trade with Detroit last August, Lewis went 93 of 157 for 1,092 yards passing with four touchdowns and three interceptions.
Lewis, however, struggled during training camp and fell behind Jeff Tuel in the competition for the No. 2 job.
Coach Doug Marrone said he was disappointed in Lewis' play, which led the team reaching the conclusion that Palmer might provide more potential despite having less playing time.
''Could Jordan be a better player than Thad? Yes, he could,'' Marrone said. ''And we're going to find that out and we'll make a decision.''
Marrone said Palmer is expected to get extensive playing time on Thursday, when Buffalo (1-3) closes its preseason hosting the Detroit Lions (2-1).
And Marrone said it was premature to suggest that Lewis' departure meant Tuel has secured the No. 2 spot for Buffalo's season opener at Chicago on Sept. 7.
In a separate move, the Bills placed starting linebacker Kiko Alonso on the reserve/non-football injury list. The second-year player is expected to miss the season after tearing a ligament in his left knee working out in Oregon on July 1.
After spending much of the past two months rehabbing, Alonso is now working out at the Bills renovated facility in Orchard Park.
The Bills also claimed punter Jordan Gay, two days after he was released by Carolina. Gay also spent last summer with the Panthers before being cut.
Palmer is the younger brother of Arizona Cardinals' starter Carson Palmer. He was selected by Washington in the sixth round of the 2007 draft, but failed to make the Redskins' roster. Palmer then spent three seasons in Cincinnati and another in Jacksonville before signing with the Bears.
Despite his lack of playing time, Palmer has developed a reputation for mentoring quarterbacks. Earlier this year, he oversaw Blake Bortles pre-draft workout during Central Florida's pro day. Bortles was selected third overall by Jacksonville.
Palmer is also familiar with Manuel. Palmer was an assistant and worked with Manuel at former quarterback Trent Dilfer's camp three years ago.
''It's great to be reunited with him,'' Palmer said. ''I'm here to compete, and I'm here to serve and help in any way I can.''
The backup spot in Buffalo has been unsettled since Marrone took over last year. And the latest shuffle leaves Marrone and general manager Doug Whaley open to being second-guessed as to why they failed to add an experienced veteran this offseason.
Last season, injuries to Manuel (knee) and veteran backup Kevin Kolb (season-ending concussion) led to the Bills scrambling to fill the position. They signed Matt Leinart, who was cut after struggling in his lone preseason appearance, acquired Lewis and signed free agent Dennis Dixon, who spent last year on the team's practice squad.
The Bills stuck with Lewis and Tuel as their backups this offseason with the expectation both can grow and develop because of their familiarity with receivers and the offensive system.
Buffalo's offense has lacked finish this preseason no matter who's been at quarterback.
The Manuel-led starters combined for four field goals on their first 18 possessions before finally scoring touchdowns on consecutive third-quarter drives in a 27-14 loss to Tampa Bay last weekend.
AP NFL website: www.pro32.ap.org and www.twitter.com/AP-NFL