Lichens are notorious for being able to grow on bare rock; they are often considered pioneering organisms, able to colonize bare rock and, in time, create enough soil to enable the growth of plants. But the lichens themselves are not plants, they are "composite organism that arises from algae or cyanobacteria living among filaments of multiple fungi species in a mutualistic relationship (Wikipedia).
Lythophytes and psammophytes
Lithophytes ("rock plants" in Greek) are plants that grow in or on rocks. Those that grow on rocks are also known as epipetric or epilithic plants. Lithophytes that grow on land feed off nutrients from rain water and nearby decaying plants, including their own dead tissue. Chasmophytes grow in fissures in rocks where soil or organic matter has accumulated.
Examples of lithophytes include several Paphiopedilum orchids, ferns, many algae and liverworts. Species that only grow on rock or gravel are obligate lithophytes. Species that grow on rocky substrate and elsewhere are facultative lithophytes.
(Wikipedia, s.v. Lythophyte)
A Nepenthes plant growing as a lythophyte in Raja Ampat, New Guinea. Photograph by Alfindra Primaldhi, available on Wikimedia under the CC BY 2.0 license.
Plants which grow on sand are called psammophytes (that's "sand plants" in Greek). Sand is finely divided rock. There are many many psammophile ("sand loving" in Greek) plants, for example:
Ammophila arenaria, marram grass. It is native to the coastlines of Europe and North Africa where it grows in the sands of beach dunes. It is a perennial grass forming stiff, hardy clumps of erect stems up to 1.2 metres (3.9 ft) in height. (Wikipedia)
Ammophila arenaria in Grenen, Denmark. Photograph by Malene Thyssen, available on Wikimedia under the GNU Free Documentation license, version 1.2 or later.
Populus euphratica, the desert poplar. It is a medium-sized deciduous tree that may grow to a height of about 15 m and a girth of 2.5 m (8.2 ft) where conditions are favourable. The stem is typically bent and forked; old stems have thick, rough, olive-green bark. The species has a very wide range, occurring naturally from North Africa, across the Middle East and Central Asia to western China.
And, of course, how could I not mention my favorite psammophiles, the salt cedars, Tamarix.
Salt cedars are evergreen or deciduous shrubs or trees growing to 1–18 m in height and forming dense thickets. The largest, Tamarix aphylla, is an evergreen tree that can grow to 18 m tall. The leaves are scale-like, almost like that of junipers, 1–2 mm long, and overlap each other along the stem. They are often encrusted with salt secretions. Tamarix species are fire-adapted, and have long tap roots that allow them to intercept deep water tables and exploit natural water resources. They are able to limit competition from other plants by taking up salt from deep ground water, accumulating it in their foliage, and from there depositing it in the surface soil where it builds up concentrations temporarily detrimental to some plants. (Wikipedia, s.v. Tamarix)
Tamarix aphylla in Algeria. Photograph by Anthere, available on Wikimedia under the GNU Free Documentation License, version 1.2 or later.