Early on Lionel Messi exchanged passes with Alexis Sanchez but the ball fell on the Argentinian's weaker right foot and he sliced into Petr Cech's side netting.
Messi was denied by the feet of Cech after some neat interplay with Cesc Fabregas before Didier Drogba poked wide from a narrow angle with a rare chance for the Blues.
Barca made the pressure pay 10 minutes before the interval when Alves laid to Isaac Cuenca, who found Sergio Busquets for a tap-in at the back post.
The game's main incident occurred minutes later when Terry appeared to knee Sanchez in the small of the back, an action spotted by the assistant referee who ordered the Chelsea captain to be dismissed.
The home side then went ahead in the tie when Messi broke clear and played in Andres Iniesta who took one touch before passing home.
Chelsea then found a remarkable away goal through Ramires, who raced clear from a Frank Lampard pass and dinked the ball cleverly over Victor Valdes.
If the score remains 2-1 Chelsea will progress by way of the away goals rule.