Amitabha, Buddha of the Western Paradise, is appropriately set into a niche in the west wall of Cave 27. Amitabha is also present in a mural on the west wall of Cave 251 and dozens of other caves at Mogao, a testimony to the tremendous popularity of this deity over many centuries.
This image was originally created in the Tang period, though it is believed extensive repairs were completed sometime during the Qing dynasty (1644-1910 CE). Originally the empty space around this image would have been filled with four sculptures (attending bodhisattvas, guardian figures, and monks are among the possibilities). This fact is determined by the presence of mandorlas (halos) painted on the walls behind where the images once stood, as well as wooden support pegs still protruding from the wall to which the statues were once attached. The fate of these images is unknown, though it was common for statues to be shifted from one cave to another at various times in the history of the caves.
Set into the alcove on in the sloped ceiling above Amitabha's niche are the figures of the Buddhas Sakyamuni and Prabhutaratna, attended by two bodhisattvas (see detail). The story of the meeting of these two Buddhas is related in Chapter 11 of the Saddharmapundarika Sutra (the Lotus Sutra), and a review of the story helps explain the unusual placement of these four figures:
Sakyamuni, the historical Buddha, is lecturing on Vulture Peak. As he speaks, a large bejeweled pagoda, the "tower of seven treasures," appears in the heavens. Sakyamuni rises into the sky and opened the door of the tower to reveal Prabhutaratna, a Buddha who had lived and achieved nirvana an immeasurably long time ago, but who had reappeared in order to hear Sakyamuni's lecture. He offered Sakyamuni half of his Lion Throne, and together they lifted themselves and the entire multitude into the sky as Sakyamuni continued his sermon.1
The positioning of Prabhutaratna and Sakyamuni in a ceiling alcove may thus be an attempt to recreate the two rising into the heavens, as described in the sutra. Furthermore, the two attending bodhisattvas sit on lotus platforms that project from the wall, which creates the illusion of floating. This is also in reference to the text, where the entire crowd gathered for the event is carried into the heavens along with the two Buddhas in order to receive Sakyamuni's teaching.
(1) Adapted from Burton Watson's translation of The Lotus Sutra (New York: Columbia University Press, 1993).
http://depts.washington.edu/silkroad/exhibit/religion/buddhism/dunhuang/cave27.html