How can scientist tell if a planet exists near a distant star?

Astronomers can detect the dim companion by observing the effects of its gravity. The dim star's gravity causes the bright star to wobble. Astronomers use this same method to detect planets around other stars