RA4 Pin pin on PIC16F876 problems
The RA4 pin is open drain (when you write 0 it's connected to the ground, when you write 1 it's floating) so you need a pull-up resistor.
You don't have to change your circuit, simply add a resistor between RA4 and Vcc (in your case 5 V). You can use a standard 10 kΩ resistor (that is usually great), lower values like 4.7 kΩ can be used if it's necessary more speed.