A simple, gracious note thanking the interviewer and expressing interest in future openings with the company is the best way to reply. Keep the reply short and simple.
Never reply to a rejection letter while upset. Don't wait too long, but writing a reply while upset from being rejected will cause the reply to come off as terse and angry.
Thank the interviewer for the time spent interviewing and mention that, while disappointed at not being selected, opportunities for other positions with the company would be welcome.
Ask if certain things could be improved to increase the chance of future employment with the company. This offers insight as to things like courses to study or the need to further polish interview skills.