The FCC gets more complaints over spam calls than anything else, and recently told telecom companies to block them for free. Until that happens, Google has made it easier for Nexus or AndroidOne device owners to see if a call is spam and block it, thanks to an update to its phone app. If you have caller ID enabled on those devices, spam or robo-calls will pop up with a red screen and warning that says "suspected spam caller." After taking or rejecting the call, you can either block the number or report that it's legit if Google flagged it in error.
Even if Google doesn't mark a call as spam, you can report it as such from the "recent calls" screen and block it. Nexus devices already have caller ID that shows companies using Google My Business listings, and references directories to show caller info from work or school accounts. For those features to work, Google notes that "your phone may need to send information about your calls to Google," presumably it can add the info to a database.
Google is actually late to this game, as Samsung's Galaxy S7 has offered caller ID and spam protection since February thanks to an alliance with Whitepages. However, spammers are nothing if not determined, and can still get through using tricks like call spoofing. Until telcos start blocking them at the source as the FCC has requested, you're still going to get spammed, even with Google and Samsung's help. The update should roll out to your Nexus or AndroidOne device soon, or you can sideload the APK here, provided you have Android 6.0 or greater.