I wonder if that's just one of the times, a true friend can't cheer someone up...but only be there for that someone.
In any case, please don't be so down on yourself because you weren't able to cheer up your friend! I'm sure he/she knew you were trying and felt better knowing you care.