29 Yahweh is David’s lamp or source of life and prosperity (cf. Job 18:6; Prov 20:20; 24:20); he dispels his servant’s darkness and brings him back to life (cf. vv 6, 16–17).
Ver. 29. First, he declares what the Lord (in connection with the exhibitions of grace in the Sauline persecution) is for him perpetually. The “for” attaches this verse as the ground or confirmation of the preceding, where David included himself among the “afflicted people,” the oppressed; the Lord has helped him “the afflicted one” out of the affliction brought on him by his enemies. All these experiences of divine help find their reason or ground in the fact that the Lord is his lamp. While “light” is always the symbol of good fortune and well-being (Job 18:5), the burning lamp denotes the source of lasting happiness and joyful strength; Job 18:6; 21:17; 29:3; Ps. 132:17; comp. Isa. 42:3; 43:17. The Psalm has the unusual expression: “thou makest light my lamp.”—What the lamp is for a man in his house, the source of joy and good fortune, this the Lord is for David: his lamp, the source of his well-being. This is the ground of David’s being called (21:17) the lamp of Israel. This is the ground of the declaration: “the Lord is my light.” (Ps. 27:1). The consequence of this is: The Lord enlightens my darkness. Darkness is the symbol of affliction—in contrast with light, without God, his lamp, he would have remained in wretchedness and ruin. His experiences are based on the general truth: it is the Lord who, as His lamp, makes even the darkness light about Him. Comp. Job 29:3. In the Psalm: “The Lord, my God, makes my darkness light.” This general declaration, proved by the past, is confirmed also for the future by setting forth the foe-conquering might which he, through the Lord’s help, has shown and will forever be able to show.
22:29 my lamp. David as the “lamp” of Israel (see note on 21:17) reflected the light of the glory of God, who was the “Lamp” of David himself.
22:29 Both the Lord and his Word function as a lamp for his people (Ps 119:105).
 MacArthur, J. F., Jr. (2006). The MacArthur study Bible: New American Standard Bible. (2 Sa 22:29). Nashville, TN: Thomas Nelson Publishers.