This study consists of 2 parts, Part A and Part B. Part A, the Phase 1 drug interaction/early viral kinetic study, will evaluate the effect of selected antiretroviral therapies on the safety, viral kinetics, and pharmacokinetics of sofosbuvir (GS-7977; PSI-7977) and its metabolites in participants with HIV and hepatitis C virus (HCV) coinfection. Part B, the Phase 2 treatment study, will investigate the efficacy and safety of sofosbuvir, pegylated interferon alpha (PEG) and ribavirin (RBV) in participants with HIV/HCV coinfection.