RDoc is system that generates documentation for the libraries you
install. ri is program that gives you command-line access to the same
documentation.
As an example, when you look at http://api.rubyonrails.org/ , you're
looking at documentation generated by RDoc.
By default, when you install a gem, RubyGems also generates the ri and
RDoc documentation files for the gem, so that you can access this
documentation locally on your computer.