The Super Bowl champions have agreed to make the quarterback the highest-paid player in the NFL, offering him a deal worth $120.6m (£80.3m) over six years.
Head coach John Harbaugh told NFL.com: "Just very happy for Joe, his family, and also for Ravens fans. He always been our QB. So to me, this is very fitting."
The 28-year-old is still to agree the marketing aspect of the contract, but it is expected that Flacco will sign the contract later today.
The agreement eclipses the five-year, $100m (£66.6m) contract signed by New Orleans Saints quarterback Drew Brees last year.