One piece of advice newbie novelists are often told is not to write for the market. What is selling today might not be selling by the time your book is ready to go to print. Ultimately, I think this is good advice; you shouldn't create your story based on what types of books are hitting bestseller lists. I also believe that writing a compelling story should be the top priority, but I think there is some advantage to considering a market.
In a perfect world, the newbie novelist will finish a book, find a great agent, find a publisher and an editor and the book will hit the shelves without any road blocks. But which shelf will it hit? Should it be shelved in mystery or literature? Literature or young adult? Young adult or fantasy? The newbie novelist usually doesn't think about these questions, but agents and editors do, and if there are too many questions about how to market a novel, it probably won't get sold.
It doesn't hurt to think about audience when plotting your book. Ask yourself, "Who is going to want to read this? Who will I be marketing this too?" If you're writing Romance, your male audience is minimal. If you're writing Sci-Fi or Fantasy, you should think about what ages your novel will appeal to. In my mind, the broader the audience, the more the book will sell. The best example I can think of is Harry Potter; clearly a fantasy story, but one that appeals to both children and adults.
The issue of shelving and audience is definitely something I've dealt with in my own writing. As both a reader and a writer, I am more drawn to characters than I am to plot. I find it more gripping when the protagonist is faced with an internal conflict than an external one. However, in the world of crime fiction, the external conflict needs to be there. If there's too much character and not enough action, you'll lose your suspense fans. But literature fans probably won't even pick up the book because it's shelved in the crime fiction section. Currently, I'm going through the book to up the suspense and endanger my protagonist more. The book will be better and easier to sell, but the decision to change plot directions was purely based on the market.
The first step is writing the best book you possibly can. If your book isn't good, it won't sell. But there are plenty of good books that don't sell either, and I believe one of the primary reasons is that the book isn't marketable. Thinking about the potential audience and marketing possibilities as you write can be a good thing. It can steer you in a particular direction, making your story more solid and focused. By no means should you try to write the next Harry Potter or next DaVinci code, but looking at why those books were successful can help you shape your own novel and make it more appealing to agents and editors.