The [http://www.itd.nps.gov/cwss/ Civil War Soldiers and Sailors System] allows name searching for soldiers. The result set gives the regiments for the soldiers. Then you can check the Wiki regiment pages to determine counties. Often knowing the counties that had men in a regiment will help you determine if a soldier was your ancestor.
=== Spanish-American War (1898) ===
*Harry E. Webber, comp. "Twelve Months with the Eighth Massachusetts Infantry in the Service of the United States". Salem, MA. Newcomb and Gauss, Printers, 1908. ([http://books.google.com/books?id=cG8tAAAAYAAJ Google Books]) ([http://search.ancestry.com/search/db.aspx?dbid=5070 Ancestry])-($)
=== World War I (1917-1918) ===