The two stars orbit the center of mass, star A travels a small circle, and thus its velocity changes little. Star B travels a bigger circle, thus its velocity changes quickly: either RED-shifted or BLUE-shifted.
Which star, A or B, is more massive in this system?
What would happen if we were looking down on the stars, such that all their motion is perpendicular to our direction? (the inclination of the orbit is important!)
What would happen if one of the stars was MUCH dimmer than its companion? How would we see the spectrum change? (These are called single-lined spectroscopic binaries).