Foreign heads of state and government 

I assume visiting foreign heads of state rank immediately after the president.  What about visiting foreign heads of government?  Can anyone find any sources on this?