This is a cactus fruit, from the genus Hylocereus, one of the Night-blooming Cereuses. The fruits are fairly soft and easy to cut with a knife, and the somewhat sweet, lightly flavored, soft-cheese-textured flesh can be scooped out with a regular spoon.
Ruth, with a house in Mérida, cuts them in halves, freezes them, then serves them as a sherbet substitute in their own shells. She describes their taste as "refreshing and palate cleansing."
The Hylocereus cactus bearing the fruit produces fleshy stems reaching up to 30 feet long and may climb onto walls and over trees with their aerial roots. Sometimes here in the Yucatán you see pitaya plantations where supports are provided for the clambering stems to grow over.
Mexicans use the name Pitaya for many kinds of cactus fruits, including small, thorn-covered ones from the wild. The fruit I was given was a particularly large one. Another variety contains red, not white, flesh.