Use www.trenitalia.com. It's the official website of Italian railways. You can find all routes and also buy tickets with credit card.
This is definitely what you need.
As you can see in the image, in the home page of the site you can search for any departure/arrival station and change the date/time of your trip (note that. The names of the stations are only in Italian. For example you can't search for Rome or Florence, instead you have to search Roma or Firenze). You can also filter the results for train type (All trains, Frecce that means high speed trains or Regional).
Once you choose your search criteria all the possible results will be shown:
In this section you can choose your preferred option and fare, and finally buy the ticket (I'm quite sure that registration is not needed).
Clicking on the
info button like indicated in the following image you will see all the stations the train will stop.
For high speed trains there is also another train company: Italo
High speed train cover only the major cities: Naples, Rome, Florence, Milan, Tourin, Bologna, Venice and some others. Instead you can reach quite any town with a regional train, even the smallest ones.
Sometimes you need to take more than one train, but the website will arrange all the train changes for you.
P.S. regional trains can be veeeery slow :)
Very useful are also these mobile applications: