The basic storyline is this (left vague enough to not spoil some of the plot twists):
It's set in Rome during the time that Napoleon was seen by a minority of people as a force of positive change. Those that were in power tended to put the Napoleon supporters in prison or execute them. One such supporter, Angelotti, has just escaped prison and hidden in a church where Mario is painting a new portrait of Mary Magdelene. As it turns out, Angelotti's sister has been coming to the church often and hidden a disguise and such for Angelotti if his escape was successful. Mario had noticed her praying in the church and used her as a model for the Magdelene portrait.
Tosca is Mario's very jealous, distrusting, and high-maintenance girlfriend. She's a real piece of work. She gets all jealous and manipulative when she sees the painting but Mario assures her it was completely innocent. Later, the police are searching for Angelotti and check the church but find only his sister's fan (the model in the painting, recall) dropped out of the disguise bundle. They use it to trick Tosca into thinking Mario must be having an affair and she goes all jealous, leading the police to his house and eventually arresting Mario and imprisoning him for being a Napoleon sympathizer. (Meanwhile, Napoleon suffers a defeat and the establishment celebrates so Tosca has to sing at the palace's celebration. Later Napoleon rallies and Mario celebrates the victory, ensuring his execution.) Tosca tries to free Mario but the hideously corrupt police chief, Scarpia, blackmails her and tricks her. The final act takes place on the roof where Mario is to be executed for his political beliefs. Being an opera, things go just about as tragically as possible.