To see how this works, you need to understand the basics of spectroscopy.The key factor in the color of a star is its temperature. Any object will give off photons at all wavelengths, in a pattern determined by its temperature:This is called "black body radiation". The sun, for example, is at about 5800K, and it has a curve that peaks in the range of visible light. That's what "white light" is: a collection of those frequencies. A red giant's temperature is closer to 4000K, which has a lot more red light and a lot less of the other colors. That's why it's red.That's all completely independent of the actual material. Heat up anything to that temperature and it glows the same color. A light bulb's filament gives off light at around 3,000K, and you get the "warm" light that's shifted to the reds. A high-temperature bulb will be hotter, closer to 4000K; it will have more blue and be interpreted as "cooler" (even though it's actually hotter.)(Note that all of that is actually warmer than most red giants. They're red compared to the sun. Daylight is actually redder than the temperature of the sun because much of the blue light is scattered by the atmosphere, making the light "warmer".)However, the material of the glowing body isn't completely unaffected by the light. Individual molecules and atoms will absorb some frequencies. They absorb very specific frequencies, in fact, the ones that allow electrons to jump from one energy level to another, as governed by quantum mechanics. If you look at a spectrum very close up, you can see tiny gaps where the atoms have absorbed particular frequencies:There's a line in the red that corresponds to the first electron in a hydrogen atom, and another in the orange that corresponds to an electron in helium. In fact, that's how helium was discovered: people saw that band in the spectrum and figured that it must correspond to something. In fact, you can pump electricity into hydrogen and have it give off that light, reversing the process, and you get out the same color:There's another line up in the red-green range corresponding to a two-quantum jump of an electron. The patterns are distinctive to that kind of atom: it will be the same anywhere in the universe. The hydrogen and helium atoms in the sun are EXACTLY the same as they are on earth, and absorb light the same way.So, now we're finally ready to answer the question. You can tell the difference between a red-shifted star and a red giant by examining the absorption patterns. A red star will be more red, but the lines will be in precisely the same place.But redshift causes the whole pattern to shift, in a predictable way. (Cf the illustration in's answer.) The relative velocity makes every wavelength appear longer, in a fashion similar to the way sound waves become deeper for an object that's moving away from you. (Listen to the wail of an ambulance some time as it passes, suddenly shifting from "coming nearer" to "going away".). This phenomenon is known as the Doppler Effect.By looking at the lines, we can tell what the star is made of. And by looking at where those lines appear, we can tell how fast the star is moving. Very small shifts in those help us determine which stars have planets: the planet's motion causes a wobble, causing the star to alternatively red and blue shift. It takes very sensitive instruments to see it, but it's been incredibly effective at finding planets in other solar systems.