What is in a smoke alarm?

It is a thingy that rings when a fire is goingto happen or something like that.