The correct rule for addressing military correspondence:
Address the recipient by their rank and last name, followed by a comma, then begin with the salutation "Sir" or "Madam."
Example: "Captain Smith, Sir,"