On Twitter one evening one of the agents I follow was going through their slush pile and tweeting about the various manuscripts, and why they were being put on the 'read more' or 'discard' piles. It was scary - so many manuscripts, and so many ways to end up on the discard pile.
High on the list was getting the spelling of the agent's first name wrong. In other words the writer failed at the second word they wrote, never mind the rest of the letter. Wow.
It may sound obvious but check on what the agent's name is and how they spell it by phoning up the agency and asking. Then address them formally as:
Dear Joe Bloggs
There are two reasons you don't include the Mr, Mrs, Miss or Ms.
First, you don't know their marital status. Take a female agent called Jane Smith. She might be married to Mr Smith now. She might have been married to a Mr Smith, which is the name by which she became established in publishing so continues to use, even though she's now divorced from Mr Smith and is currently single. She might choose to use her birth name, even though she's married to Mr Jones.
Second, you might not know what sex they are and may cause offence by addressing a man as Ms Smith. There are lots of unisex names - Jo, Val, Chris. And there are names that can cause confusion. My middle name, for example, is Leslie which is the male way of spelling it (my father didn't know there Lesley was the female spelling when he registered my birth).
So check the name with the agency and use the format Dear Joe Bloggs and you won't go wrong on the second word.