This is a great post from Seth Godin about bad ideas. I don't even have to give it a huge intro. You need to just go read it. The briefest synopsis would be that one has to be willing to generate lots of bad ideas in order to land on a good one. You should read it from Seth though. He says it so much better than me.
Let's spend a minute making it relevant to writing though. Maby people feel liek failed writers because they write a book and then can't sell it. Maybe it's not the right book for right now. Write another and another and another. Maybe the first one would be a better second or third book. Keep generating stuff and eventually you will hit the right stuff.
Now go read Seth's blog.