Guitar solos appear in many kinds of music. Classical, jazz, folk, blues, and rock music all feature solo guitar performances. Sometimes these are recreations of previously conceived musical phrases, and sometimes they are improvised. Regardless of what you prefer, performing either of these types of solos is made easier after you learn guitar scales.
Some guitarists learn solos by memorizing finger patterns on the fretboard...