After a goalless first half in which both sides had chances to score, Messi gave the visitors the lead in the 71st minute when he finished off a sweeping counter-attack after combining with Neymar.
Against a side like that you have to take your opportunities
And the Ballon d’Or winner then doubled his side’s lead when he scored a penalty in the 83rd minute after substitute Mathieu Flamini clumsily brought down him in the box.
The result leaves Arsenal with it all to do heading into the return leg in Barcelona in three weeks’ time.
And Ramsey admitted that the north London side were punished for not taking their chances at Emirates Stadium.
Speaking to BT Sport after the game, Ramsey said: “I thought we did really well, especially in the first half. We created a few opportunities but we didn’t manage to take any.
“Against a side like that you have to take your opportunities. Their three strikers have got so many goals between them – they average a goal a game so one of them is going to score.”
He added: “It’s obviously going to be tough for us now but we’ll go there [to Camp Nou] and try our hardest.”
Arsenal now turn their attentions back to Premier League affairs and their trip to Manchester United on Sunday afternoon.
MORE: Man United latest news
MORE: Arsenal latest news
MORE: Chelsea latest news
MORE: Liverpool latest news