Adult soldier beetles (family Cantharidae) are usually found on flowers, and these individuals were no exception (Triplehorn and Johnson 2005). I noticed a number of them crawling around on a roughleaf dogwood (Cornus drummondii, Cornaceae), feeding on nectar and pollen. The larvae, in contrast, are predaceous on other insects (Triplehorn and Johnson 2005).
Soldier beetles bear a strong resemblance to the closely-related fireflies (family Lampyridae). A couple of features are useful to distinguish them. First, fireflies have short heads that are usually hidden by their pronotums when viewed from above. Soldier beetle heads stick out a bit farther, as seen with the individual in the first photo above (Triplehorn and Johnson 2005). Second, unlike most fireflies, soldier beetles are active in the day and lack light-producing organs (although there are diurnal fireflies that also lack such organs).
Triplehorn, C.A. and N.F. Johnson. 2005. Borror and DeLong’s Introduction to the Study of Insects. Seventh Edition. Thomson Brooks/Cole, Belmont, CA.