How do computers access memory
You are sort of close.

All computers or microprocessors have something called an Address Bus and a Data Bus. The address bus, as you imagined is a number of individual lines each of which will be driven either with a logic high or a logic low level. Logic high being a voltage close the voltage rail used to power the processor, or bus. Logic zero is normally close to ground.

The address bus can be various widths, that iss more or less lines, depending on the processor. The presented code of high and low levels is then termed an address. Each memory location has it's own specific address associated with it and when that address is presented, it is decoded and that memory location is accessed. The data is then transferred through the data bus. 

(Aside: in some architectures, part of the address is actually passed on the data bus during the addressing phase.)

So. having established that, on to your question.

Memory is normally accessed in one of two main ways. Either by the processor to retrieve instructions to execute, or, to store or retrieve data on command of the instructions.

Inside the computer there is a counter called the instruction pointer. This simple counter increments as each instruction, or part instruction is processed. So in this case, the instruction pointer is simply fed out to the address bus. (Note: The counter does not always count linearly. Anything like a jump instruction can set the counter to a new memory location at any time, thus allowing the program to perform loops, call subroutines, etc.

As instructions are executed, some of them call for a read or write to memory and include a pointer to the address, or to a variable that contains a pointer to that address. The computer recognizes these instructions and passes the address from that location out on the address bus and performs the needed read or write as instructed.

All of this happens under the control of a state machine that sequences everything in the right order and with the right timing.