For me it's one of those "you know it when you see it" type of things. If you take an objective look at the quality & quantity of the tv spots, posters, trailers, etc. it's usually pretty easy to separate the winners from the stinkers. And quality doesn't necessarily mean the movie looks good, it's if the marketing is effectively singling out the target audience for the film, presenting them the movie in an easily understood/accessible way (they know what it's about, and want to see more), and in the best case scenario appealing to those outside of the main audience the studio is hoping to attract.
Right now I'd say The Da Vinci Code has the best marketing campaign going on, it's got a huge built-in audience with those who read and loved the book, plus the ads will draw in those who are fans of Tom Hanks/Ron Howard, those who enjoy a good mystery/thriller, and even a few religious folk due to the storyline. It's really got everything going for it, its only hangup so far has been Tom Hanks' hair
I think a lot of movies that fail at the box office have marketing that is focused on the wrong audience for that movie or a target audience that is much too limited. Recent examples being Slither & American Dreamz. And sometimes the marketing is be too broad, trying to appeal to so many different types of people that it ends up attracting almost no one. Like with Freedomland and Something New (perhaps with the upcoming Poseidon as well). And of course there are tons of movies that are just doomed to failure, i.e. they look wholly unappealing to almost any sane person no matter how hard the marketers try to convince us otherwise.