When chocolate turns gray, one of two things could be the culprit: sugar bloom or fat bloom.
Sugar bloom is normally caused by surface moisture. The moisture causes the sugar in the chocolate to dissolve. Once the moisture evaporates, sugar crystals remain on the surface. If this process is repeated, the surface can become sticky and even more discolored. Although sugar bloom is most often the result of overly humid storage, it can happen when the chocolate has been stored at a relatively cool temperature and is then moved too quickly into much warmer surroundings. When this happens, the chocolate sweats, producing surface moisture.
Fat bloom is similar to sugar bloom, except that it is fat or cocoa butter that is separating from the chocolate and depositing itself on the outside of the candy. As with sugar bloom, the most common causes of fat bloom are quick temperature changes and overly-warm storage.
Although it might look a little less appetizing than a lustrous, rich chocolatey-brown piece of candy, chocolate that has suffered bloom is still okay to eat. You may find the texture of sugar-bloomed chocolate to be a bit grainy on the outside, but it should still taste good. To prevent this from happening to your chocolate, simply use proper storage methods.