The categorization of nearly missing another plane is different between the UK and US. See: What is the relationship between the terms "airprox" and "near mid-air collision"?
UK
As for the procedure, for the UK (where it's called an AIRPROX) it should be reported over the radio if the controller's workload permits, else later in writing after landing.
An AIRPROX Report should be made by any pilot flying in the United Kingdom Flight Information Region, the Upper Flight Information Region or Shanwick Oceanic Area when in his opinion, the distance between aircraft as well as their relative positions and speed have been such that the safety of the aircraft involved was or may have been compromised.
So if it is in the pilot's opinion that an AIRPROX took place, it should be reported. The message needs to start with, "AIRPROX report." Following the report it will be confirmed in writing within 7 days.
The contents of the message the pilot should transmit are:
- Aircraft Callsign
- SSR Code
- Position of AIRPROX Aircraft heading
- Flight level, altitude or height
- Altimeter setting
- Aircraft attitude (level/climbing/descending/turning) Weather conditions
- Date and time (UTC) of the AIRPROX Description of other aircraft
- First sighting distance and details of flight paths of reporting and
reported aircraft.
Source: CAP 413
USA
Similar reporting is explained for the US in the FAA AIM 7−6−3 Near Midair Collision Reporting. They can also be reported after the fact in writing.
The reported items are similar to the ones above, extra items include but not limited to:
- Degree of evasive action taken, if any (from both aircraft, if possible).
- Injuries, if any.