Over what should he rejoice?
Rashi: He should rejoice in his portion.
Seforno: The opportunity to actualize and perfect his intellect. This is Simchah of Torah. 'Lo Alecha ha'Melachah Ligmor v'Lo Atah Ben Chorin Livatel Mimenu' (Avos 2:2).
Metzudas David: He should rejoice in all his days, and not be upset with any one of them.
What are the days of darkness?
Ibn Ezra, Rashbam, Rid: The days in the grave.
Seforno: They are days when he cannot attain spiritual light.
What is the consequence of remembering the days of darkness?
Rashi: He will fix his deeds to be saved from them 1 , i.e. eternal death for Resha'im.
Ibn Ezra: It will embitter the light for him.
Rashbam: He will not sin in this world; refer to 11:8:5:4.
Seforno: He will strive to attain what perfection he can in this world, for he cannot attain it in the days of darkness.
How many days of darkness will there be?
Rashi: They will be more than the days of life.
What is the meaning of "Kol she'Ba Havel"?
Rav Sadya Gaon: All that already came is Hevel.
Rashi: All that comes on him will be Hevel and darkness. Hevel can be an expression of punishments and afflictions - "va'Hevel Ba uva'Choshech Yelech" (6:4).
Ibn Ezra: He will understand that everything that comes to the world is Hevel, like "Dor Holech v'Dor Ba" (1:4).
Rashbam: If he will sin, all his days after death will be Hevel and evil.
Rid: When he realizes that much darkness will come, all the good that he had will seem to him like Hevel, as if it was nothing.
Seforno: Deeds done in the name of a man after death, e.g. Hekdesh - even though there is good from them, it is small compared to what is done in his lifetime.
Metzudas David: The afflictions after death are Hevel, without purpose. When man is alive, afflictions cause him to investigate his deeds. After death there is no room for this.