How do I create a driver with a random value and apply that driver to multiple objects?
You don't need a driver to accomplish this. Simply select all the rock elements you want to affect. Then use the Randomize Transform command and edit the XYZ Rotation values in the side panel. 

This will give you a randomized starting rotation for each rock. 



Now, with all the rocks selected, click CTRL+A and choose Apply Rotation.

Now we want to add a driver to the XYZ rotation values for each rock. We want this value to be constant throughout the animation. We can do this by using a multiple of the frame number.

First, select all the rocks and add them to a group named "ROCKS".

Then open up the text editor and run this script:

import bpy
import random

for obj in bpy.data.objects:
    randomSpeed = random.randint(1,20)*0.001

    for group in obj.users_group:
        if group.name == "ROCKS":
            for i in range(0,3):
                fCurveOb = obj.driver_add("rotation_euler", i)
                drv = fCurveOb.driver
                drv.type = "SCRIPTED"
                drv.expression = "frame*" + str(randomSpeed)
                drv.show_debug_info = True


This will set the XYZ rotation values to increment each frame. You can increase the rotation rate by increasing the 0.01 value.