Final answer:
The ultrabasic rock that sometimes contains diamonds is kimberlite, which is known to transport diamonds from deep below the Earth's surface to accessible depths due to volcanic activity. The correct option is 2.
Step-by-step explanation:
The type of ultrabasic rock that sometimes contains diamonds is kimberlite. Kimberlite is an igneous rock that is known to be a source of diamonds, especially in regions of ancient volcanic activity.
Diamonds form under high-pressure, high-temperature conditions far below the Earth's surface and are brought to the surface by deep-source volcanic eruptions through these ultrabasic rocks.
Pegmatite, granite, and rhyolite do not typically contain diamonds, as these rocks are generally associated with more silica-rich, rather than ultramafic, compositions.
Hence, Option 2 is correct.