Joe Flacco completed 12 of 23 passes for 282 yards and two touchdowns for the Ravens, who limped into the AFC wild-card playoff game with losses in four of their last five regular season games.
Flacco, who becomes the first quarterback to earn at least one playoff win in each of his first five years, averaged more than 12 yards in each of his completions.
His favourite target was Anquan Boldin, who caught five passes for 145 yards, including an 18-yard scoring strike from Flacco in the fourth quarter that gave the Ravens their 24-9 lead.
Rookie Andrew Luck, who guided the Colts' march to the postseason following last year's miserable 2-14 campaign, threw for 288 yards on 28 of 54 passing but was victimised by too many drops by his receivers.
Indianapolis, despite driving downfield repeatedly, had to settle for three field goals by veteran Adam Vinatieri.
The 37-year-old Lewis, a 13-time Pro Bowler widely considered the best linebacker of his generation, announced Wednesday he would be retiring after this season, his 17th in the National Football League.
Lewis, a 13-time Pro Bowl selection and former Super Bowl MVP, missed the last 10 games with a torn right triceps. He started the game and made 13 tackles, each of them cheered wildly by the crowd of 71,379 at M&T Bank Stadium.
"My total focus today was to come in and play my heart out and get my team a win," he said afterwards. "Everything else just came with it.
"There was probably no greater moment than seeing my kids, my mom, my dad — my family right there in the end zone. That was probably when I lost it emotionally because I knew everything I have always done has been for them."
Ravens defender Paul Kruger also excelled, registering 2 1/2 of the Ravens' three sacks of Luck and causing one of three turnovers by forcing a fumble.
"It was truly electric," Kruger said. "We had the crowd going crazy, we had more media than ever and we had Ray getting your mind right, and there were so many reasons to fight on and play with the passion that was required.
"Ray's been our leader and captain for so many years, and I'm glad we were able to make it happen for him."
When the game ended, Lewis launched into his signature dance, an inspirational pregame ritual that fires up the fans as much his teammates. Players from both teams surrounded the 13-time Pro Bowl linebacker in a show of respect.
Even if they continue to win, the Ravens will not have another home game this season, meaning Sunday's victory over the Colts was Lewis's swan song in Baltimore.
Baltimore took control of the game in the third quarter when Flacco found Dennis Pitta on a 20-yard touchdown pass to give the Ravens a 17-6 lead.
A 26-yard field goal by Vinatieri in the final minute of the quarter trimmed the Ravens' lead to 17-9 but the Colts were able to get no closer.
Follow us @SprtNationalUAE