There are two ways to go about this. The first is direct: "Dude, they aren't going to hire you." Then follow it up with "here's why...".
The second, means swallowing your pride. Maybe youryou're wrong. Maybe, he's exactly what they are looking for; maybe he can step up intoto the responsibilities the job entails.
I would much rather my friends tell me the truth, as they see it, thenthan for them to tip toe-toe around a subject because they are too chicken littleChicken Little to broach it. A few questions for you: would you take away your friends car keys if you felt he had too much to drink? Would you tell him his girlfriend is bad for him? Would you tell him his zipper was undone?
If you can answer Yes"Yes" to all of those then you should have a good enough relationship to just be direct. If you can't, then this person probably isn't an actual friend and, instead, is just more of an acquaintance. If that's the case then you don't really have a conundrum. A friend is someone that is comfortable telling you that you suck. An acquaintance is someone you maybe have a beer with every so often or simply see at work, in which case stay out of their way.
Going further, what does it matter if your friend does apply and doesn't get the job? Or, applies and is hired? It's not the end of the world either way. After all you aren't the hiring manager, so it's not exactly your responsibility.