I work in HR and this is how we approach this situation.
"We at (company name) appreciate you submitting your application. You have not been selected for this position however I would like to encourage you to reapply when we have another opening." Then ask "Do you have any questions?" After you answer their questions stand, shake their hand, lead them to the door. Be kind and sincere. It's a tough world out there and everyone deserves encouragement. If you have any other resources that would help the applicant I personally believe this places a great value on your company's integrity. The applicant should leave with a good feeling about your company even though they will not be working there. Good luck :)