Yeah you're approach sounds perfect. there are a couple pieces:
stars with hover effect:
jquery: http://www.fyneworks.com/jquery/star-rating/
prototype: http://www.fyneworks.com/jquery/star-rating/
css: http://www.henryhoffman.com/css-star-rating-tutorial.html
onclick can invoke an ajax call with jquery:
http://api.jquery.com/jQuery.post/
then on the server side it can be maintained in a rating table
theres a longer example here:
http://webtint.net/tutorials/5-star-rating-system-in-php-mysql-and-jquery/