1. They drilled through several layers of rock to reach the oil.

2. They drilled through several layers of a rock to reach the oil.

3. They drilled through several layers of rocks to reach the oil.
=========================
Which one is right? Do we have to use 'rock,' 'a rock,' or 'rocks.'

The first one is right. Possibly the third, but not the second.

The first is really the best.