The building originally was the great baths of Rome, built in about the 3rd century. Most of the place had fallen into ruins, but like so much of Rome was just kept around. The original baths was a huge structure, and the current basilica is only a part of it, made from the "cold rooms". For many years, there was a desire to turn this grand but decaying building into a church. The task was taken up by Michelangelo, very late in his life.
The building is also famous for its Medirian Line, essentially a giant solar clock carved into the floor. It was created with an aperture on the wall so that at solar noon (when the sun is highest in the sky), the light would mark a spot on a line on the floor. Unfortunately, it was a bit too cloudy to see it today. It marks its furthest point along the line on the winter solstice, December 21.
Here is slideshow of the pictures: