Interpolations have always been a part of Broadway musicals; only a select few songwriters were ever powerful enough to have it in their contracts that only they would write the songs. But in many shows, particularly from the '40s through the '60s, the rule was that only the lead songwriters would be credited, no matter who else contributed. And also in the '40s through the '60s, some of the leading songwriters increasingly started getting into producing and publishing. And if you're Frank Loesser, and you have a stake in a show, wouldn't you help out with some uncredited doctoring as needed?
Loesser seems to be the center of a lot of these rumors, because after Guys and Dolls he became very hands-on in promoting young or new-to-Broadway talent and getting the publishing contracts for their shows. Kismet, The Pajama Game, Damn Yankees and The Music Man are shows he was involved with in this way.
With The Music Man, the one section Loesser is often thought to have written is the opening and closing section of "My White Knight," a quasi-operatic arioso that sounds a bit like the music and lyrics he had turned out the year before in Most Happy Fella. When The Music Man was adapted for the screen, Meredith Willson dropped that section and wrote a new song (but kept the "White Knight" interlude, the one that starts "all I want is an honest man..." which everyone agrees Willson wrote), which gave extra credibility to the idea that this was the one non-Willson part of the score. On the other hand, rumors can be unreliable; people have sometimes identified "Till There Was You" as a Loesser song, which it most certainly is not (Willson had already written a version of it before The Music Man).
Update: John Baxindine writes:
There is not even the slightest possibility that Loesser wrote the melody of "My White Knight." It fits neatly into counterpoint with "The Sadder But Wiser Girl," and the two were originally to have been reprised that way in the footbridge scene.
What he may have done - this is Jon Alan Conrad's theory, as I recall - is suggest to Willson that he transform the original, patter-based number into a ballad. (The original version is recorded on Barbara Cook's Carnegie Hall album.)
The Pajama Game, by Richard Adler and Jerry Ross, is the center of a lot more rumors. They were young pop songwriters whom Loesser recommended to the producers, and he acted as both their publisher and mentor. It was such a confident score for two first-time theatre songwriters that there was always going to be a lot of talk that they needed help. But the big hits from the score are actually usually thought to be theirs. The rumors I've heard about Loesser's contributions are usually focused on two songs that John Raitt identified as Loesser's: novelty/country duet "There Once Was a Man," which does sound a bit like Loesser in its parodic edge, and "A New Town Is a Blue Town," which is one of the dullest songs in the score.
Loesser has also been rumored as the author of some of the other songs, but short of clear evidence of Loesser or Adler/Ross writing these, it's hard to say -- their work is (obviously) very much influenced by Loesser, so anything they wrote themselves could sound like it was his. ("I'll Never Be Jealous Again" appears to be one of theirs, but like a lot of light duets in '50s musicals it's influenced by Loesser's "Baby, It's Cold Outside" and other Loesser duets where the two singers step on each other's lines.) Steven Suskin's "Show Tunes" book also suggests that "Her Is" might have been Loesser's, but Hal Prince, who produced the show, suggests that it was Adler and Ross, and I think that one sounds very much unlike Loesser.
There are fewer rumors about Richard Rodgers, because most of the shows he worked on were his own (he produced Annie Get Your Gun, but there's never been any suggestion that Irving Berlin needed help). He is said to have written one song, "The Guy Who Brought Me," from Best Foot Forward, which he produced for his protégés Hugh Martin and Ralph Blane. Jule Styne produced a few shows by other composers, and Steven Suskin's The Sound of Broadway Music reports that Styne definitely ghost-composed a few songs in a flop called Something More!
In other shows, the contributions of ghosts are more definitely known but the extent of their contributions are in doubt. On Hello, Dolly! it is known that David Merrick, the producer, called in Bob Merrill (whom he'd worked with on two previous shows) to write new songs, and that the songs were "Motherhood" and "Elegance." Jerry Herman, the show's songwriter, has admitted that the ideas -- lyrical and melodic -- came from Merrill on those two songs, but claims that he finished the songs himself. Others say Merrill claimed to have written both of them all the way through. (Not, again, that "Motherhood," the ultimate filler song that sort of works in context but nowhere else, is a particularly great credit to have.) Merrick also got Charles Strouse and Lee Adams to write a song called "Before the Parade Passes By," leading to years of confusion about who wrote the song used in the show: consensus seems to be -- based on the style of the song -- that Herman wrote a song of his own with Strouse and Adams's title. Whether any of the Strouse and Adams version remained in Herman's, or whether Herman's was completely new apart from the title, no one will know until the earlier version is discovered.
Herman himself was called in that same year to help out on a show called Ben Franklin In Paris, with a score by two first-time songwriters. Herman wrote two or three songs, with program credit for additional material. And the writers of 1964's other big smash, Fiddler On the Roof, worked in the same capacity on the Sherlock Holmes musical Baker Street. On those shows, it's a bit easier to tell the ghost contributions: Bock and Harnick's Baker Street songs have a dry wit that the rest of the score doesn't, and Jerry Herman is, well, Jerry Herman, credited or not.
The early-to-mid '60s seems to have been a busy time for ghosts. When the Mary Rodgers/Martin Charnin musical Hot Spot, a misbegotten vehicle for Judy Holliday, was in trouble in 1963, Stephen Sondheim came in -- a friend of both Rodgers and Charnin, and not yet box-office poison. Holliday's first number, "Don't Laugh," is usually jointly credited to Sondheim, Rodgers and Charnin, though I've heard several versions of who wrote it. Steven Suskin's book Show Tunes says it's music by Rodgers, lyrics by Sondheim with revisions by Charnin; others say it's Sondheim's own song.
Of course on any of these shows, there are always whispers that someone in the music department might have covered for -- or composed for -- the credited composer. One known instance of this is on Silk Stockings, where Cole Porter was sick and unable to be with the show full-time during the tryout. Needing a dance number in the second act, the producers got the show's orchestrator, Don Walker, to compose it: the song was called "Red Blues," and it managed to make it into the show and the movie version. (Update: John Baxindine says that Porter himself asked Walker to compose the piece, because Porter couldn't come up with something "sufficiently square.") On a 1959 musical called Saratoga, with a very disappointing score by Harold Arlen and Johnny Mercer, Arlen was sick during the tryout and Mercer wrote his music for a couple of the songs.
This isn't even getting into whole other category of numbers that someone else, often the dance arranger, creates. (An example is "Rose's Turn" from Gypsy, which was worked out by Sondheim and Jerome Robbins and then finished with Jule Styne, but all based on Styne's themes. And then there's the "Small House of Uncle Thomas" ballet, an original composition by dance arranger Trude Rittmann.) But that's not really ghost-writing.