Bartoli studied physics and mathematics at the University of Pisa until 1874. He was Professor of Physics at the Technical Institute of Arezzo from 1876, at the University of Sassari from 1878, at the Technical Institute of Firenze from 1879, at the University of Catania from 1886 to 1893, and at the University of Pavia from 1893.
In 1874 James Clerk Maxwell found out that the existence of tensions in the ether like the radiation pressure follows from the electromagnetic theory.  In 1876 Bartoli derived the existence of radiation pressure from thermodynamics. He argued that the radiant temperature of a body can be raised by reflecting its light from a moving mirror, and therefore it is possible to transport energy from a colder to a hotter body. To avoid this violation of the second law of thermodynamics, it is necessary that light impart a pressure to the mirror.  Therefore, the radiation pressure was also called "Maxwell-Bartoli pressure".
Later the radiation pressure played an important role in the work of Albert Einstein in connection with mass-energy equivalence and the photoelectric effect. Einstein lived in Pavia at that time (1895), when Bartoli held the Physics chair at the local University. However, it is unknown whether Einstein was directly influenced by Bartoli.