The ratio of masses can be calculated using the relationship between acceleration due to gravity, mass, and radius (g = GM/R²).