The win sets up the first Super Bowl coached by brothers, Baltimore's John Harbaugh and San Francisco's Jim. The 49ers won the NFC title earlier Sunday 28-24 at Atlanta.
The 49ers have been listed as 5-point favorites.
Flacco had two touchdown passes to Anquan Boldin and one to Dennis Pitta as the Ravens outscored the Patriots 21-0 in the second half.
Baltimore's defense made Brady look ordinary and stymied the league's top offense. Brady was 67-0 at home when leading at halftime.