Pericarditis is the inflammation of the pericardium, a thin, two-layered sac that surrounds your heart. The layers have a small amount of fluid between them to prevent friction when the heart beats. When the layers are inflamed, it can result in chest pain.