Reb Yeruchum explains the Torah's use of the word "mekeitz" as opposed to simply saying "And it was two years" based on the midrash, which quotes the possuk "keitz som l'chosech" - "an end he placed for darkness" - as referring to the two-year period during which Yosef sat in the darkness of jail.
Explains Reb Yerucham, that darkness has a "keitz" - it is a finite creation that has an end. In contrast, Hashem's greatness, about which the possuk says, "v'legedulso ain chayker." The Torah is teaching us that there is a light at the end of every tunnel because the tunnel of darkness necessarily has an end. And once the end comes -- in Yosef's case, after two years -- of necessity, there will be light because once the darkness ends nothing more is needed for light. We all have moments of darkness that we think will never end. But the Torah is teaching otherwise.
Perhaps, this is why we celebrate 8 days of Chanukah, even though there was enough oil for one day. The first light alludes to the fact that darkness and golus are not without an end. There always will be a pach shemesh - a light at the end.
Thank you, Hashem, for taking me from darkness to light. May we quickly be zoche to Your Ohr Gadol. A wonderful Shabbos, Rosh Chodesh and Chanuka to all.