Eustis Clay cannot wait to finish his peacetime service and move on to bigger, better things. He is a personal favorite of Master Sergeant Maxwell Slaughter, a career soldier who is considerably brighter than Eustis, but enjoys his company and loyalty. Slaughter is a totally institutionalized lifer, wired into all the perks, back channels, and supply sources an army base can provide filtering through his near autonomous cabin hub. Eustis is involved in a number of schemes and scams, including one in which he will sell tickets to see an equally dim private named Meltzer run a three-minute mile. He inconveniences Slaughter more than once, including a traffic mishap that requires him being bailed out of jail. Determined to tempt Slaughter with the joys of civilian life before his hitch is up, Eustis fixes him up on a date with the much younger, not-too-bright Bobby Jo Pepperdine. At first, Slaughter is offended, but gradually he sees another side of Bobby Jo, including a mutual fondness for crossword puzzles. Eustis and Slaughter golf together and begin to enjoy the good life. One night, Eustis is devastated to learn of the death of Donald, his dog. A pair of hated rivals use their status as Military Policemen to lure Eustis into a barroom brawl. He is beaten two-against-one and is nearly defeated when Slaughter angrily comes to his rescue. Together they win the fight, but the middle-aged, overweight Slaughter collapses from the effort. Hospitalized, Slaughter delights Eustis by suggesting that they leave the Army together and go live on a tropical isle, surrounded by blue seas and beautiful girls. Slaughter dies, however, and Eustis, a changed man, re-enlists in the Army.
William Goldman based the novel on his experience of being in the US Army from 1952–1954, setting it at the fictional "Southern" Army post, Camp Scott, in the spring and summer of 1953. He says he was stuck during the writing, and gave it to his then-roommate John Kander to read and it was Kander who suggested the girl character, who is only 14 years old at her first appearance, be made into a major figure. This helped Goldman finish the rest of the book. Goldman says the publisher put pressure on him to change the ending:
It was one of the first three books of the firm, and they said, "We can't publish this ending. It's a downer. We guarantee you the book won't sell. Will you change it? I said, "I will absolutely change it, and I will give it a very happy ending, if you can guarantee me the book will sell." They said, "Obviously, we can't guarantee that," and I said, "Obviously, I can't change the ending."
Goldman says the character of Clay "was sympathetic for me. There was a sergeant who was a villain, but I thought Clay was just a nice affable stoop. I'd been in the army. A lot of this stuff is also, as I look back on it, autobiographical." The novel received mixed reviews. Although Goldman went on to become a noted screenwriter, he was not involved in the adaptation. "They made changes", said Goldman of the film. "No one says, 'Oh, we are going to fuck up Bill Goldman's book.' Most of this stuff I didn't pay any attention to. I don't know that I've ever seen Soldier in the Rain. I must have because I like Tuesday Weld but as a rule I don't look at movies I'm involved with and I don't read books that I've written. One does the best one can and that's it."