Gravitational lensing caused by a planet passing in front of a distant star will bend light from that star, and that can also be used to detect dark planets that have been ejected from solar systems.
NASA Ames/JPL-Caltech/T. Pyle via WikimediaCommons