Shakespeare's Sonnet 18 "Shall I Compare Thee to A Summer's Day" addresses a loved one whose beauty far outstrips that of nature's. The lines you are referring to are as follows:
And every fair from fair sometime declines,
By chance or nature's changing course untrimm'd
Until these lines, the speaker explains that nature's beauty is imperfect--a summer day can be too hot, too windy, cloudy, or short. Surely his beloved's beauty has none of these imperfections.
In the lines that you have questioned, the speaker gives another reason that his beloved's beauty is superior: it is eternal. You are correct in your inference that "fair" refers to beauty. In this case, the speaker declares that nature's beauty can become less so "by chance" or by "nature's changing course untrimm'd." "Chance" most likely means circumstances, such as injury or sickness, that are beyond our control. The reference to nature and its seasons most likely refers to age that is certain to occur, phenomenon that happens in nature and in humans.
The subject's beauty will not change because of circumstance or age as long as the speaker's poem lives. He has eternalized the subject's beauty through his poem.