In the US, "Esq." is the abbreviation for "Esquire" and indicates that the addressee is an attorney. It's becoming somewhat archaic, though, and isn't absolutely necessary to use it when corresponding with a lawyer.
Mr. is used to address a male, Mrs. a married female, Miss an unmarried female, and Ms. if you're uncertain whether or not a woman is married. How can you tell if the addressee is male or female? It used to be easier to tell by the name - John Smith was always a man, Jane Jones was always a woman. Today, however, more and more people (in the US, anyway) have names like "Peyton Smith" or "Addison Jones", and it's a 50/50 guess as to what gender they might be. If you don't know the person, all you can do is make an educated guess.