It's not cool to stand by. It just is taken as tacit approval. And even if it was not unusual in the past, technology is supposed to be about change, right?
You say, "We should be more professional, it's uncool to talk about hot a coworker is," or "I'm really not comfortable wen you talk about her breasts, even if it's a joke" or, "I don't think you'd want me to go tell her you said that she only got promoted because she wears short skirts, cut it out," or even, "Hey man, this isn't Uber, don't say you'd hire her because of what she looks like."
Naming the specific behavior is important. It's embarrassing, and people don't do things they are embarrassed for.
Then you look at them until they look away or whatever. It's a dominance thing, so try to do so when you are standing and they are sitting down. If they try to make excuses, insist they stop and not repeat it. Practice with a friend if you need to.
Record the incident to your personal email from your corporate email, so it's nicely datestamped. If it happens more then once, report it to HR and your supervisor as a pattern of problematic behavior, with documentation.
If it's a supervisor, I'd email HR and their supervisor the first time it happens. If you get fired or they give you a negative review, retaliation is also illegal.
If HR doesn't do anything, come back to HN, reference this thread, and someone will try to find you help.