How can the mass of an invisible planet be determined?

Careful measurement and calculation has given us much knowledge about space and the universe around us. If we look at other planetary bodies of known mass that orbit near the one that is not visible, we can crunch numbers and determine the mass of the unknown. We can measure the effect the invisible body has on visible and known bodies and arrive at the numbers that account for the orbital perturbation of our known objects. And we're good at this. The idea of finding the mass of an unseen planet is the next step after "discovering" a planetary body without first seeing it by noticing a slight effect on the orbit of other planetary bodies nearby. That's how Neptune was discovered; its existence was proved by applying mathematical tools to other observations. ("Look at this data! There has to be something else out there affecting the other planets!") And that was back in 1846! Waaaay cool!