The basic key to getting the head to react to the motion of the body is using the Slow Parent function. Similar results can be achieved with soft body or cloth sim, however, this method has the advantage of no simulation baking.
The slow parent function is then used the drive the rotation of the head around the center of the body, so that acceleration causes the head to "lag" behind the body.
First we will set up the rotation of the ball based on location. Start with the ball, next, add an empty. This will be the control for your droid. I chose the type of circle, and rotated it by 90 degrees along the X axis, and set the display size to 1.1, to create something that looks like a belt:
Next, I named it Ctrl (name your emtpies now, or you will become hopelessly confused).
We want our ball to be at the location of our control object. We could parent it, but that might cause conflict over the rotation later. Instead we will use a copy location constraint, with the object set to Ctrl. leave all other settings as they stand.
In order to have the ball rotate correctly, we will need two drivers, linked to the X and Y location of the control object respectively.
To add a driver, select the ball, and go into the object properties. In the X and Y rotation boxes, enter a pound sign (#).
Next, enter the graph editor, it is time to setup some drivers! Switch to driver mode:
Starting with the X Euler Rotation, we need to add a variable, var. Use single property, and set the object to Ctrl (aren't you glad we named it :D). Into the data bath box, enter
location. This will get the Y location of our droid. Set the expression to
Repeat for the Y Euler Rotation, except use location in the data path.
var (not negative) for the expression this time.
Our rotation is now set up, but lets quickly look back to the expression we used,
-var. This might not seem logical at first, since you'd think we'd need to multiply be π and some number of degrees etc; however, we aren't working with degrees we are working with radians. 1 Radian is equal to a turn such that the each point on the circumference of the is moved along by a distance equal to the radius of the circle in the direction of rotation. Basically, if our droid has a radius of 1, it will turn 180 degrees when we travel π radius. So, when our droid moves π units, it will rotate by 180 degrees, which is the correct rotation. Note the actual expression should be -var * 1 since it is location * radius in blender units. If your droid has a radius other then one, be sure the put the multiplication in there.
After writing this, I did a couple tests, and I am now convinced that the above method of driving rotation produces incorrect results. I am still searching for a definitive answer to this, at least the above method has the benefit of producing reasonably convincing results, so it is being left in.
Now, its on to the head. This is where the slow parent comes back in. For this portion, we will need three new empties all added at the origin. Name these "Drag", "Face", and "Point".
We'll deal with drag first. It needs to be parented to Ctrl, but with slow parent under relation extras checked. The offset will control the amount of forward motion the head has when the droid moves. I liked a value of 1.8, but set it to whatever looks right for you.
Drag now, as it name implies, drags behind the droid. We can use this to drive the position of the head.
Lets work on "face" next. This empty should face drag, hence the name. To do this, we need to use a track to constraint. Add a track to constraint and set the target to drag, that is all that needs to be done. leave the other settings at default. Finally, add a copy location constraint to face, set to Ctrl, like the one we used on the sphere earlier.
Finally it is time to work with "Point". Point works by pointing to the location of the center of the head. when the head is parented to point, it will move to this location on the outside of the sphere. The set up for point consists of two constraints and a driver.
The first constraint is yet another copy location set to Ctrl, like we had earlier. With "Face" and the droid body. The second constraint is a copy rotation constraint, which should have the target set to "Face: and only the X axis checked:
Finally, we need to set up a driver that uses "Drag" to animate the position of the head. In the X rotation property of "Point" add a driver by entering the pound sign (#), and proceed into the graph editor.
Add anther variable, but this time set it from Single Property to Distance and select the Ctrl and Drag objects. Finally, enter var into the expression.
Last but not least, parent BB8's Head to the "Point" object.
Lets watch our droid roll!
Note: The head may act strangely while you position the droid or jump to a different position in the timeline. However, when you play back a completed animation, it should act normally.