Use a hammer and nail to apply deep gouges and scratches in the bookshelf as desired. Keep these sparse: you want to make the bookshelf look distressed, not abused.
Paint the bookshelf with a primer that is a few shades lighter than your desired color. Allow the primer to dry for 24 hours.
Rub the side of an old candle on the areas that you want to look distressed. Areas such as the edges of the shelves and frame should be your main focus points, but you can also distress sections of the sides and the shelf surfaces.
Apply a coat of latex or acrylic paint in a shade lighter than the desired shade over the entire bookshelf. Allow it to dry to the touch.
Thin paint in the desired shade with water until it is runny. Blot it onto the bookshelf randomly with a wadded rag, then blot off the excess with a second one. The paint will stay in the deeper dings and crevices, but will only be a light mottle on the surface. Allow it to dry for 24 hours.
Sand the areas that you want distressed with medium sandpaper and a wire brush. The candle wax will help the paint to pull away more easily, exposing the lighter primer underneath.
Stop frequently while you work to look at the bookshelf as a whole. You don't want to over-distress any particular section. You can always add more, but you can't take away.
Apply a coat of clear lacquer when you are finished to protect your work.