The potentials of the electronic states of RbXY4 molecules, XY4 = CF4, CH4, SiF4 and SiH4, correlating with the ground 5s 2S1/2 and excited 5p ^2P1/2,3/2 states of the Rb atom are studied using the methods of ab initio quantum chemistry. The calculations are performed by the SCF method of the full active space of orbitals, taking into account dynamic electronic correlations and spin-orbital interaction. It is established that the character of the interaction in the A and A' states, correlating respectively with the lower and upper states of the Rb (5p ^2P1/2,3/2) doublet and corresponding to the perpendicular orientation of the Rb p-orbital relative to the Rb-X axis, differ significantly (attraction or repulsion) for different XY4 molecules, which is explained by the difference in the charge distribution in the XY4 molecules. In order to evaluate the accuracy of the calculation results for RbXY4 molecules, similar calculations are performed for the diatomic RbAr molecule using different basis sets. It is found that, as compared with the A and A' states, the potential of the repulsive B state, which correlates with the upper state of the doublet and corresponds to the orientation of the Rb p-orbital along the Rb-X axis, is significantly more sensitive to the size of the basis set which is due to the accuracy of accounting for the configuration interaction with states that correlate with the Rb (6s ^2S1/2) and Rb (4d ^2D3/2,5/2) states and other states of the Rb atom lying above Rb (5p ^2P1/2,3/2). Keywords: alkali metals, excited states, carbon tetrafluoride, quantum chemistry, ab initio calculations.