Henrietta Leavitt (1868-1921) compared photographs of various parts of the sky, taken on separate occasions, to identify variable stars. She discovered many Cepheids, most in a nearby small companion galaxy known as the Small Magellenic Cloud. She noted that the brighter ones took longer to change brightness:
Small Magellenic Cloud
Since all the Cepheids in the SMC are (just about) at the same distance, the fact that the brighter ones have longer periods means that period and luminosity are related. If we could find the distance to a Cepheid somehow, we could derive a relationship between period and absolute magnitude which we could use as a distance indicator.
Cepheids are rare stars, and so they are typically far away and we don't have parallaxes for many. Some Galactic Cepheids have parallaxes from the Hubble Space Telescope, so their luminosities are accurately known, others we can get distances for using main sequence fitting or other distance measures. This lets us derive the Cepheid period-luminosity relationship.
HST Parallax Cepheids
Benedict et al (2007)
MV = -2.43[log(P) - 1] - 4.05
MV = -2.43log(P) -1.62
(remember, in this expression,
period is measured in days)
So, once we have a calibrated relationship, if we find a new Cepheid and derive its period, we can then immediately calculate its absolute magnitude. Then, having observed its apparent magnitude, we can calculate the distance.
Cepheids are evolved high mass stars!
There are other types of pulsating stars, which define an instability strip on the H-R diagram: