Stellar Mass Determination is most accurately determined for binaries that eclipse including one of whose orbital velocity can be determined by Astrometry or the Doppler effects of the Radial Velocity. From the velocity (or directly by astrometry), the size of the orbit can be determined, and once the period of the orbit is determined, the total mass can be determined, by Kepler's observations and Newton's theory of Gravity:
R³ M =~ —— P²
The Doppler Shifts due to the radial velocity are affected by the angle at which the orbit is being viewed, but if the binary is eclipsing, the angle is pretty clear.
The masses of the individual stars can be determined if the center of mass can be determined through astrometry. In some cases, one star is much larger than the other and the derived total mass is a good first approximation of the mass of the heavier star.
Once masses of some nearby stars have been determined, relationships involving mass, Luminosity, Spectral Class, and the H-R Diagram allow the masses of other stars to be estimated.