On Thursday Yahoo rolled out deeper integration with Facebook as part of its SearchMonkey open semantic program. Now, when a person's public Facebook profile shows up in search results, there's a list of options on top that let you add them as a friend, send them a message, poke them, and see who they're friends with.
This (obviously) only works on Facebook profiles that have been made available for indexing by search engines, something Facebook introduced in late 2007. Users also have the option to opt out of getting their profiles indexed entirely.
One thing you can do to improve seeing someone's profile at the top of Yahoo results is add "on Facebook" to your search, as that's how Facebook formats the listing. In most cases, simply adding that brought up the person's Facebook listing to the top where it was otherwise showing up on the second or third result pages.