Now while we have looked at the colors separately let’s investigate the pairing itself. The main way I see this pairing working is where the colors are used equally. In patterns (which are increasing in popularity) and other such designs with the usage of white/blank space this color combination works surprisingly well. The gray anchors the yellow and keeps everything from being too bright overall.
Using yellow as the background with gray as the type color and vice versa are other combinations I can see working under certain select circumstances as well however this may not be a lasting combination.