The key for stellar classification is the Hertzsprung-Russell diagram (or HRD for brevity), also know as the color-magnitude diagram.
This shows the relation between the surface temperature (on the x-axis) of a star and its luminosity (on the y-axis). The temperature is an index of the Spectral type. For distant stars also spectroscopy is taken into account, to classify spectral types according to their absorption lines here some examples. The usual classification is called MKK (from the astronomers that had developed it - Morgan, Keenan and Kellman in 1943), and divides the stars in 7 stellar types O, B, A, F, G, K, M. Please note that from the 1943 other stellar types have added, but these are the most used. This sequence goes from the hottest (O) to coolest (M) stars. Each letter class is then subdivided using a numeric digit with 0 being hottest and 9 being coolest. Our Sun is a G2 type star. This classification also uses an additional notation to avoid the "degeneracy" you mentioned: a roman numeral between "I" (one) and "V" (five). The higher the number, the wider the lines in the observed spectrum. However, despite of the quantity these roman numbers indicate, they are an index of luminosity class. This is based on the width of certain absorption lines in the star's spectrum which vary with the density of the atmosphere and so distinguish giant stars from dwarfs. Luminosity class I stars are supergiants, class III regular giants, and class V dwarfs or main-sequence stars, with II for bright giants, IV for sub-giants, and VI for sub-dwarfs (from here). Then, our Sun is "completely" identified by the type G2V. You can take a look at the figure below, and check out by yourself where it belongs:
.
Also note that other indexes are used to characterize the stars, as for the width of the lines in the luminosity class, or for some peculiarities.
Finally, if you are interested in the study of stars, you should always keep in mind the Stefan-Boltzmann law:
$L=4\pi\sigma R^2 T^4$
By this you can identify isoradii lines in the HR diagram:
Also, there is a proportionality between luminosity and mass:
$L\sim M^{3.5}$
Then you can identify "isomasses" lines in the HR diagram, but I can't find such a figure to show.