Rybelsus and Ozempic both contain semaglutide and are used to treat type 2 diabetes. However, Rybelsus is taken orally as a tablet, while Ozempic is administered as a subcutaneous injection.