The closest equivalent of 'race' in genetics are haplogroups, which can be reliably used to track ancestry and migration by anthropologists. Within larger haplogroups there are smaller groups called haplotypes. These are determined by looking at alleles on the Y chromosome, which is passed down more or less unaltered from father to son and so can allow clear lines of ancestry to be traced and then analyzed en masse to get a picture of how people have migrated and mingled over the ages and then to associate other broad genetic shifts with those trends. Mitochondrial DNA also helps to do this on the female side.

These don't just determine surface characteristics but other invisible ones as well. In Africa, for example, the pathology of Sickle Cell Anemia is tied to different haplotypes. Sickle Cell genes evolved over thousands of years in Africa because, while two copies of the gene lead to a crippling blood disease, one copy gives you resistance to malarial diseases. Among a group with high reproduction rates, a relatively small chance of one offspring having a serious health condition was 'worth it' to confer resistance to an incredibly dangerous and ubiquitous environmental hazard on most of the population from the cold, impersonal perspective of nature.
Other examples off the top of my head are lactose intolerance being less common among northern European haplotypes and elevated flushing and severe physiological reaction to alcohol being preponderant among East Asian haplogroups. Races are typically a 'larger' grouping of haplotypes based on historical migration chokepoints. For example, East Asians have mostly four different haplogroups: O-M175, C-M130, D-M174, and N-M231, with the first being the most dominant. Despite a quite complex series of migrations into and out of Southeast Asia and the peripheral steppe, the presence of these four indicates one or more genetic bottlenecks in the past and a distinct genetic isolation of this group of people from the surrounding areas.
Usually, these bottlenecks are associated with geographical barriers - the Bering Strait land bridge, Panama, the Himalayas, the Sahara, the deserts of Central Asia like the Taklamakan and Gobi. Another misconception that has somehow wedged itself into people's mind is that trade routes were migration routes. Vasco de Gama going from Portugal to India was a first. Merchant caravans were not going from Constantinople to the Dzungarian Gate. You had multiple cities along the trade routes and mostly short-range caravans which would shuffle goods from city to city in a long chain. Information and goods travelled down these routes but not people, for the most part. This is how, for example, Indonesia largely converted to Islam with miniscule ethnic Arab or Persian migration. When people moved en masse back then it was typically either as a nomadic tribe covering a large but flat and seasonally arid territory or as an invading force.