Twice now in fewer than two weeks, police officers have been targeted in lethal mass shootings by men apparently looking to avenge the deaths of African-Americans at the hands of law enforcement.

So what to do about it? Grieve, of course. And denounce. But ratcheting back the violence will require a better understanding of the nature and extent of the frictions among police officers and the communities they risk their lives to serve. It will require a deeper understanding of the real grievances of people who feel the justice and political systems do not hear them. But it also will require patience. There are no instant solutions to the deep-rooted problems with race relations, overpolicing, implicit bias and mistrust, civilians' easy access to military-style firearms, and other factors that have led the nation to this dysfunctional juncture. Meanwhile, the attacks in Baton Rouge, La., and Dallas only heighten the sense of danger that police officers, trained to look out for their own safety as well as others', may feel as they interact with the public.

There also needs to be a better and more transparent system of accountability. The acquittal Monday of the third of six Baltimore officers (the trial of a fourth ended in a hung jury) charged in the death of Freddie Gray raises fresh questions about how police should treat those in their custody. Gray died last year of injuries suffered when he bounced around unsecured by safety restraints in the back of a police transport van. Investigations into the deaths of unarmed people at the hands of police too often end in findings that the officers broke no laws or procedures, when common sense tells us that the behavior was unacceptable. If the problem is police policies or legal definitions, then they should be reassessed and recast.

Notably, no statistics beyond those compiled by the media exist on how often police kill civilians, on the demographics of those encounters or on how many of them are justified by the circumstances. That is where we start: Figuring out the scope of the problem, then devising policies to target it.

FROM AN EDITORIAL IN THE LOS ANGELES TIMES