Diamond and graphite are both made of the same atom, carbon. Diamond has a tetrahedron structure while graphite has a flat hexagonal structure. Why is diamond transparent while graphite is not (at least not with more than a couple of layers)?
The answer lies in the band structure of the two materials. The band structure describes how the electrons in a solid are bound, and what other energy states are available to them.
Very simply, the band gap for transparent diamonds is very wide (see this link):
Normally, diamond is not a conductor: all the electrons live in the "valence band", and you need a photon with at least 5.4 eV of energy to push an electron into the conduction band. In the process, that photon would be absorbed. A photon with less energy cannot give its energy to an electron, because that electron "has nowhere to go". And since visible light has energies of between 1.65 and 3.1 eV, only UV photons have enough energy to be absorbed by pure diamond.
That same link also describes how impurities give rise to color in diamond: for example, nitrogen atoms produce an "intermediate" energy level, and this gives rise to more energetic electrons that could jump the gap to the conduction band and absorb light.
By contrast, graphite is a conductor. As a conductor, it has electrons in the conduction band already. You know this, because even a tiny voltage will give rise to a current - this tells us that the electrons didn't need to be "lifted" into the conduction band first. And since electrons will absorb any amount of energy easily, the material absorbs all wavelengths of light: which makes it black.
Diamonds are unstable compared to coal (or more exactly, graphite) so high temperature and pressure are required for diamonds to form from graphite. The reason that coal (graphite) is black and diamonds are clear has to do with how the carbon atoms are connected together in the two different forms of carbon. In diamond each carbon atom is bonded to its neighbors like the points of a pyramid. In graphite (coal) the atoms are connected to one another is flat planes. The flat planes can absorb light of all wavelengths (colors) while the pyramids found in diamonds cannot absorb any visible light and as a result are transparent. The reason for the difference is that the electrons in the large flat sheets of graphite can all "jiggle" at many frequencies, but the tightly bound and constrained electrons in diamond are not free to "jiggle" and thus cannot absorb light. Heat and pressure change coal into diamond, but it is the change in crystal structure that results in the color change. Graphite is composed of flat sheets of carbon similar to shale and basically keeps going in all direction until the end of the sheet. Diamond is a 7-carbon crystal, which is 3-dimentional and therefore gives the crystal light refracting properites. Color is a result of light absorbtion or light reflextion. Black means that all possible colors are being absorbed and white means that all colors are reflected. In the case of diamond, it is clear because light passes through it.