Participants were randomly assigned to treatment with ranibizumab or bevacizumab and to 2 years of monthly or as needed injections or monthly injections for 1 year and as needed injections the following year .