How to add/insert a class to a sidebar in single.php?

How can I accomplish this in the most efficient way?

As Rarst indicates, don’t change the class to change the style. Leave the class the same and use CSS Specificity to change the style on certain pages.

When WordPress creates a page in a theme that uses the body_class() function it adds a lot of information about the page in the html class of the body tag. Look at that tag on a page created by single.php and that class will include the class name single.

Use that to specify the style for single.php files.

#secondary {
    /** These styles work on all pages. */
}

body.single #secondary {
    /** These styles only work on single.php pages. */
}

body.home #secondary {
    /** These styles only work on home pages. */
}

See the body_class() function for details on which classes are added.