It’s a universal feeling, and even King David, the shepherd-turned-king, knew it well. That’s why he declared, "A lamp to my feet is Your word, a light to my path" (Psalm 119:105). But when exactly did David utter these powerful words?

Midrash Tehillim, a collection of rabbinic commentaries on the Book of Psalms, offers us a fascinating glimpse into the moments that inspired this verse. It suggests that David spoke these words during a particularly precarious time: when he was heading to the Valley of Rephaim to face his enemies.

Now, you might think a king, especially one as skilled as David, would just charge into battle. But David wasn't like that. Before engaging the sons of Manasseh, who ambushed him as he headed to Ziklag (as we read in 1 Chronicles 12:21), he consulted the Urim and Thummim. These were oracular objects, perhaps stones, worn by the High Priest to receive divine guidance. Think of them as an ancient way of asking God for a "yes" or "no" answer. And who lit the way for him in that dark time? According to the Midrash, it was lightning and thunder! "Be my light, O Lord, and my salvation," David cried out.

The Midrash then draws a sharp contrast between David and King Saul. Remember the story of Samuel anointing David as the future king? The angels, according to the Midrash, were in an uproar! They questioned God's decision to take the kingship from Saul and give it to David. God, in turn, explained the difference between the two. Saul, in a moment of panic when facing the Philistines (1 Samuel 14:19), cut short his inquiry with the Urim and Thummim. But David? When the Philistines attacked in the Valley of Rephaim, he immediately sought divine counsel (2 Samuel 5:22-23).

David didn't just ask once. When the Philistines kept coming, he inquired again! And God's response wasn't a straightforward attack plan. Instead, God instructed him to circle around and approach from the balsam trees.

Why the balsam trees? Rabbi Berechiah offers a compelling reason: because the other side was covered in thorns. It was a test of faith, a moment of waiting for the opportune time. The Midrash connects this to Job 14:1, "If a man dies, will he live again? All the days of my hard service I will wait for my renewal to come." Rabbi Berechiah explains that the thorny symbol is at the beginning of the book of Job because it is full of thorns, just as Israel's suffering is always before God. As Psalm 91:15 says, "I am with him in trouble."

The story continues: When the Philistines were a mere eight cubits away, the Israelites were terrified. David, however, remained calm. He reminded them of the divine instruction: they were not to strike until they saw the tops of the trees waving. To act prematurely would be a fatal mistake. "It is better to die innocent than to die guilty," he declared, urging them to place their trust in God. And as soon as they did, the trees began to wave! Then, and only then, did they strike the Philistines, just as God had commanded (2 Samuel 5:25).

God, witnessing David's unwavering faith, declared to His angels, "See what is between Saul and David. Who caused David to be saved and His word to shine upon him? Be a lamp to his feet."

So, what can we take away from this? Perhaps it's the importance of seeking guidance, of trusting in a higher power, even when surrounded by darkness. Maybe it’s about patiently waiting for the right moment, even when fear urges us to act rashly. David’s story reminds us that even in the face of overwhelming odds, faith, coupled with careful consideration and divine guidance, can illuminate our path and lead us to victory. Just like a lamp to our feet, God’s word, and our trust in it, can guide us through the darkest valleys.