You could think of a photon in this case as simply a little bundle of energy. That energy is absorbed by the material, and the photon ceases to exist. An analogy would be waves crashing on a shore -- the wave carries energy, which is absorbed by the shore. Where did the wave go?
Of course this is a vastly simplified answer. A photon is the quanta of energy in the electromagnetic field, while ocean waves are not quantized at all. The important thing to understand is that a photon is not a material object like something you can hold in your hand, and there should be no reason to expect that it should continue to exist after an interaction.