Sure, he's a fine writer whose stories have terrified generations of fans. And sure, he's served as the inspiration for countless writers after him. But if he's done writers a disservice, it would be that he's spoiled authors into thinking they can use any song lyrics in their writing projects, so long they cite the songwriter.
Think back to your time in school when you used to write term papers. Your teacher might have insisted on a minimum number of research citations to back up your point of view, all of them cited in perfect MLA style with a "works cited" page at the end. Now crack open just about any of Mr. King's books, and chances are you'll find song lyrics. Inserting lyrics into his works appears to be something he loves doing, and for good reason, because lyrics can really help a story along when used properly.
Putting two and two together, you might reason that you can use anybody's lyrics so long as you provide attribution, especially since, well, if Mr. King can do it, why can't you? Nope, sorry. The reason why you can't do that is: copyright infringement. Need another reason? Try this one on for size: expensive lawsuits with you as the defendant.
Now, I'm not insinuating Mr. King has done anything untoward. Not at all — in fact, I'd wager he properly secured the legal rights to use the lyrics that appear in his books. In legalese, getting permission to do something is called "licensing." Thus, for those song lyrics to appear in Mr. King's books, he would have had to have licensed them first.
"But wait!" I hear you shouting from across the interwebs. "I only used five words from that song. That's so miniscule that I should be safe." No, sorry. There isn't any such "safety net" threshold.
"But what about fair use?" you protest. Without getting too far along this tangent, the concept of fair use is a defense to infringement. Which is to say, you'll still get sued, except now you might have some chance at defeating the lawsuit. Merely shouting "Fair use!" in court won't work. You'll have to convince the judge your use of the lyrics is "fair" by meeting certain narrow legal criteria. Weighing your options, it's far better to avoid getting sued in the first place.
Of course, you could always license the song lyrics you want, but this takes time, money, and effort. You may not want to put your writing in hold while negotiating the rights to reprint those lyrics. Also, the rights-holders can refuse to license you that song for any reason, and they'd be within their rights to do so.
There are alternatives to using copyrighted song lyrics in your writing. The first is simply: don't use them. Rarely will a particular song be so crucial to your story that it will fall apart unless those lyrics are used. Another alternative is to reference the song or artist without using any lyrics, for instance: "He strode up to the dockside bar as Jimmy Buffet blasted through the worn-out speakers." No lyrics there, and using the artist or band names will not normally draw the ire of music publishers. A third alternative is to simply make up a new song that suits your purposes. As an original creation, no one will hold the rights to it but you.
All things considered, this primer is by no means an comprehensive guide to music licensing, and it might not even apply to the copyright scheme in the country where you live. Also, all kidding aside, Mr. King is a great writer and a pretty decent human being, so I'm told.
Now get back to writing. May the words come easy and your coffee pot never be empty.