 Illumina Inc. shares sank more than 22 after hours Thursday after the gene-sequencing company swung to a loss in the second quarter, fell short of revenue expectations and revised its full-year outlook downward. 