What do astronomers analyze to determine the composition and surface temperature of stars?

Analyzing Stars

Light is in a star produced by high energy levels raising the heat to a point that the molecules of the elements in the star start to "glow". Simply stated, the light spectrum of different materials causes specific anomalies in the measured light, and it is possible to detect the temperature of the star AND the elements by analyzing the light spectrum that it gives off.

spectral analysis

OR intsead of saying "GLOW"??

YOU CAN SAY BY ITS' BRIGHTNESS You can look at a star and light from a spectrometer. This is what tells what the element on the star is.