Sofosbuvir is used along with ribavirin (Copegus, Rebetol, Ribasphere, others) and sometimes another medication (peginterferon alfa [Pegasys]) to treat certain types of chronic hepatitis C (an ongoing viral infection that damages the liver) in adults.