Astronomers determine the mass of stars and planets in other solar systems primarily through the mass-luminosity relation, which provides an approximate mass based on luminosity. For binary stars, direct mass measurements can be achieved using Kepler's laws, observing their orbital dynamics. The mass of exoplanets is inferred from the Doppler shift of their parent stars, which indicates the star's "wobble" due to gravitational interactions. Additionally, the gravitational mass can be calculated by measuring the orbital period and dimensions of a body orbiting a star. Overall, various methods, including interferometry and gravitational calculations, contribute to accurate mass determinations in astrophysics.