I know I can use generating functions. Each of the die has a generating function $x+x^2+x^3+x^4+x^5+x^6$, and so I need to find the coefficient of $x^9$ in the generating function of their sum, $(x+x^2+x^3+x^4+x^5+x^6)^3$. I am not sure how to do this, however, short of expanding it all out.
(I'm not just trying to get the answer but also the method behind it. Thanks a lot.)
The number of compositions of $n$ into exactly $k$ parts is $\binom{n-1}{k-1}=\binom{8}{2}=28$
Since a composition assumes each dice carries at least the number $1$ (no zeroes), this would permit a $7$ on any of the 3 dice. So we must exclude the three possibilities in which the red dice, the yellow dice or the black dice might have a 7 on (i.e. $\{7,1,1\},\{1,7,1\},\{1,1,7\}$).
$28-3=25$