Though the pigeons' homing instinct has been known for centuries (news of Napoleon's defeat at Waterloo reached England first by carrier pigeon), only fairly recently have we begun to understand how bird navigation works. Radar evidence shows that migrants largely ignore important geographical features such as bends in major rivers and curves in coastlines. Clearly, birds have something else going for them.
In 1951, Gustav Kramer confined several European Starlings, Sturnus vulgaris -- the same species found around many human habitations in North America, shown at the right -- in "orientation cages." It happens that when caged starlings want to migrate, they tend to face toward the direction they'd like to fly toward. By using mirrors, Kramer caused the starlings to think that the Sun was where it really wasn't. Consequently, the caged starlings turned to face where they should face IF the Sun were where the mirrors said, but not where the Sun really was. Seeing this, Kramer knew that starlings have an interior "sun compass."
Also during the 1950's, Franz and Eleanor Sauer found that certain birds released in an enclosed planetarium oriented according to the "stars'" apparent position. Back then, people assumed from this finding that birds must possess a genetically based knowledge of star positions.
However, in 1967, Stephen Emlen at New York's Cornell University, also using a closed planetarium, showed that Indigo Buntings, Passerina cyanea -- a molting male shown at the left -- oriented not from the stars' positions in the sky, but rather from the north-south orientation that could be determined from the stars' rotation around the polar stars.
If you make a time-exposure picture of the starry sky at night, including the North Star in your view, a pattern of streaked stars will result, as shown in the photo at the right. Only the North Star at the center appears not to move. The farther a star is from the North Star, the longer its streaked tail. Over time, the North Star seems to be at the center of a vortex. Emlen's buntings determined "north and south" not from the stars' locations, but from this rotation around the polar stars.
By now it seems we should already know how birds navigate, but, wait, there's more...
Also in the 1960s, W Wiltschiko and others in Germany placed a Helmholtz coil around covered cages of European Robins, Erithacus rubecula, one of which is shown below. Helmholtz coils can cancel the effects of the Earth's magnetic field lines on the space inside the coils. Within covered cages surrounded by a Helmholtz coil canceling the Earth's magnetic field lines, the robins lost their sense of direction. Moreover, when the Helmholtz coil created magnetic field lines opposite to and stronger than the Earth's natural lines, the robins oriented as if north were south, and south were north.
Therefore: Certain birds can definitely use the Sun and/or the stars and/or the Earth's magnetic field lines, and who knows what else, to navigate by. Once they're very close to home they probably also notice local landmarks, and navigate to their very nests the way a human might, though that's just an anthropomorphic guess.
Despite all of the above, very much still is not known about bird migration. Also, only a few bird species have been studied, so it's risky to apply what little is known to all species. A good guess is that migrating birds typically use more than one method.