Pillow lavas are formed underwater. They take the shape of a pillow when rapidly solidifying at the surface. They are usually basalt.
They form mainly at oceanic ridges, but can also be seen in Hawaii when a hot fluid lava flow moves under the ocean after an eruption on the island.
The temperature of the lava that forms the pillows varies from 1000 to 1200 degrees. The lava gets covered with a film of glass, and because it has not completely cooled, it forms a sort of flexible pillow cover, progressively swollen by the lava still being emitted. Thus we eventually end up with pillow-shaped blobs with a size of several metres, over several thicknesses. Ophiolithic formations are full of them.