When this happens it’s not the case that the friend’s email address has been hacked, as many people think.
If it was, then the actual address would be the same. And there’d possibly be sent emails in their outbox.
It’s more likely that the spammer or virus spreader has been able to associate two known contacts somehow, as you’re more likely to open an email from someone you know.