In the middle of a New England winter, protagonists Sandy and Dennys accidentally disturb an experiment in their parents' laboratory, and are teleported to a sandy desert. There, they are acquired by water-prospector 'Japheth', and guided by him to an oasis; but Dennys is separated from the others.
Sandy remains with Japheth and his elderly grandfather Lamech and is cured of his heat stroke by a variety of improbable beings, including a brethren of seraphim who disguise themselves, periodically, as animals.
Dennys reappears in another tent, only to be thrown into a refuse heap, and comes under the care of a friendly family in the center of the oasis, headed by a gruff but kindly patriarch, called Noah. It soon becomes apparent that the boys have been interpolated into the story of Noah's Ark, shortly before the Deluge. The nephilim meanwhile distrust the twins, and their human wives investigate; but discover nothing.
Separated for much of the book, the twins become more independent of each other, and gain maturity over the course of a year in the desert. Both are in love with Noah's daughter Yalith (and she with them), but do not consummate their affection. Dennys convinces Noah to reconcile with Lamech, and both twins eventually care for the old man's gardens while he lies ill. After Lamech's death, Sandy is kidnapped, and eventually found by Japheth. Both twins assist the construction of the Ark; whereupon they are sent home on unicorns summoned by the seraphim.