What happnes depends mostly on your operating system. If you have normal memory access, then nothing will happen. the value is simply read whatever is there at the time. If access to the page is not allowed, then your program will generate a page fault, which the OS has to deal with.
If the page is on disc, because it was swapped out, then the OS will load the page, and resume your program where it left off. Your programm will not notice this. If the page is invalid then the OS will raise an exception and depending on the OS you may be able to catch it, or your program will crash.
If the access is done on the kernel level and can not be resolved, your OS will most likely crash with a kernel panic, or if it is well written, it may just disable the driver, that caused it.