The following is my personal opinion, I don't claim it's provably objectively best.
And would they send the rejection by mail or email (including PDF attachment)?
Physical mail is too slow; don't prolong the pain. And this is doubly true if they're from abroad.
email is perhaps less dignified, but it's acceptable, especially if the applicant thinks about the above consideration. If you do it that way, make two versions: The body of the mail and an official rejection as a PDF.
But I think what you should do is make a phone call personally to reject. That allows them to do a bit of venting or fishing for information with whoever calls them - and it's up to that person to withstand this or to disclose some information - but emotionally it's less frustrating in my opinion. It also emphasizes how they weren't rejected out-of-hand, automatically, mechanically. Of course - the phone call doesn't come instead of the other options; after making the phone call, send the email or the physical letter (which is perfectly ok in that situation.
Do they tell the applicant about the reasons for the rejection?
This depends on what you mean by "a good way". It's more convenient for you - personally and as a department - not to say anything. The rejectee won't be able to argue, or to appeal, or in extreme cases to sue.
But if you care about the rejectee at all, then definitely be forthcoming with them. If you have a somewhat formalized procedure for evaluating the different candidates, that would be a good crutch for such a description: "While we were impressed by your X, another candidate presented a more impressive Y". If you really want to be candid and help the guy/girl on their next attempt, disclose what you had perceived as flaws - although that's the kind of disclosure likeliest to elicit arguments.
Do they try to do more to soften the bad news?
Generally, no. You very rarely have anything to say that will actually soften the blow. However, the personal communication - such as a phone conversation - does soften the blow IMO.