318 sb with a four barrel carb

Fuel pump.

I've been dealing with this problem on a '55 Dodge Coronet (still a mechanical fuel pump), when the engine would heat up the pump would start pushing more and more air through the lines, to the point of dropping the fuel pressure to 0 and stalling the car out. I've been able to resolve the issue for the most part with a new fuel pump. Its actually a high volume Carter pump for a 318, mounted to the 270 poly with an adaptor. Part # is M6270, will bolt right up to your 318. Pump is made in the US too, not like the cheaper Carter models.

A spacer isn't going to solve your problem btw, the fuel isn't boiling in the carb. The pump is getting hot because it's bolted to the block, and you're seeing the bubbles before the fuel even reaches the carb. I'd also check the condition of the fuel lines between the tank and the pump to make sure there aren't any dents/crimps in the metal line, and check any rubber lines for deterioration.