"Marah and Elim Today 'tis Elim with its palms and wells, And happy shade for desert weariness; 'Twas Marah yesterday, all rock and sand, Unshaded solitude and dreariness. Yet the same desert holds them both, the same Hot breezes wander o'er the lonely ground; The same low stretch of valley shelters both, And the same mountains compass them around. MH 258"
"And when they came to Marah, they could not drink of the waters of Marah, for they were bitter: therefore the name of it was called Marah. And the people murmured against Moses, saying, What shall we drink? And he cried unto the Lord; and the Lord shewed him a tree, which when he had cast into the waters, the waters were made sweet: there he made for them a statute and an ordinance, and there he proved them, And said, If thou wilt diligently hearken to the voice of the Lord thy God, and wilt do that which is right in his sight, and wilt give ear to his commandments, and keep all his statutes, I will put none of these diseases upon thee, which I have brought upon the Egyptians: for I am the Lord that healeth thee. And they came to Elim, where were twelve wells of water, and threescore and ten palm trees: and they encamped there by the waters."
EGW uses the example of Marah and Elim to illustrate the contrast between difficult and pleasant experiences in life, drawing directly from the biblical narrative in Exodus 15:23-27.
"If those who are suffering from ill-health would forget self in their interest for others; if they would fulfill the Lord's command to minister to those more needy than themselves, they would realize the truthfulness of the prophetic promise, “Then shall thy light break forth as the morning, and thine health shall spring forth speedily.” MH 258.1"
"Then shall thy light break forth as the morning, and thine health shall spring forth speedily: and thy righteousness shall go before thee; the glory of the Lord shall be thy rereward."
EGW directly quotes Isaiah 58:8, making this an explicit allusion.
"So it is here with us on earth, and so I do remember it has ever been; The bitter and the sweet, the grief and joy, Lie near together, but a day between. MH 258.3"
"A time to weep, and a time to laugh; a time to mourn, and a time to dance;"
Both passages deal with the juxtaposition of positive and negative experiences in life. The EGW quote directly mentions 'bitter and sweet, grief and joy' while Ecclesiastes speaks of 'a time to weep, and a time to laugh; a time to mourn, and a time to dance.' The connection is clear and meaningful.
"Sometimes God turns our bitter into sweet, Sometimes He gives us pleasant watersprings; Sometimes He shades us with His pillar cloud, And sometimes to a blessed palm shade brings. MH 258.4"
"And he cried unto the Lord; and the Lord shewed him a tree, which when he had cast into the waters, the waters were made sweet: there he made for them a statute and an ordinance, and there he proved them,"
The EGW quote directly alludes to the Exodus passage where God turns bitter water into sweet water. The phrase 'Sometimes God turns our bitter into sweet' is a clear reference to the biblical event.